chore: fix tests
We are not using the `!` suffix anymore for keywords.
This commit is contained in:
parent
3d58c4d115
commit
7627458aac
10 changed files with 22 additions and 22 deletions
|
|
@ -3,7 +3,7 @@ class Zero (α : Type u) where
|
|||
|
||||
export Zero (zero)
|
||||
|
||||
instance [Zero α] : OfNat α (natLit! 0) where
|
||||
instance [Zero α] : OfNat α (nat_lit 0) where
|
||||
ofNat := zero
|
||||
|
||||
class AddGroup (α : Type u) extends Add α, Zero α, Neg α where
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
abbrev Zero α := OfNat α (natLit! 0)
|
||||
abbrev Zero α := OfNat α (nat_lit 0)
|
||||
|
||||
class Monoid (α : Type u) [Zero α] extends Add α where
|
||||
zero_add (a : α) : 0 + a = a
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ class One (α : Type u) where
|
|||
one : α
|
||||
export One (one)
|
||||
|
||||
instance [One α] : OfNat α (natLit! 1) where
|
||||
instance [One α] : OfNat α (nat_lit 1) where
|
||||
ofNat := one
|
||||
|
||||
class Zero (α : Type u) where
|
||||
zero : α
|
||||
export Zero (zero)
|
||||
|
||||
instance [Zero α] : OfNat α (natLit! 0) where
|
||||
instance [Zero α] : OfNat α (nat_lit 0) where
|
||||
ofNat := zero
|
||||
|
||||
class MulComm (α : Type u) [Mul α] : Prop where
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ instance [CommSemigroup α] : MulComm α where
|
|||
class One (α : Type u) where
|
||||
one : α
|
||||
|
||||
instance [One α] : OfNat α (natLit! 1) where
|
||||
instance [One α] : OfNat α (nat_lit 1) where
|
||||
ofNat := One.one
|
||||
|
||||
class Monoid (α : Type u) extends Semigroup α, One α where
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ abbrev inv {G : Group} (a : G) : G :=
|
|||
|
||||
postfix:max "⁻¹" => inv
|
||||
|
||||
instance (G : Group) : OfNat (coeSort G.toMagma) (natLit! 1) where
|
||||
instance (G : Group) : OfNat (coeSort G.toMagma) (nat_lit 1) where
|
||||
ofNat := G.one
|
||||
|
||||
instance (G : Group) : OfNat (G.toMagma.α) (natLit! 1) where
|
||||
instance (G : Group) : OfNat (G.toMagma.α) (nat_lit 1) where
|
||||
ofNat := G.one
|
||||
|
||||
structure CommGroup extends Group where
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
def one (α : Type u) [OfNat α (natLit! 1)] : α := 1
|
||||
def one (α : Type u) [OfNat α (nat_lit 1)] : α := 1
|
||||
|
||||
abbrev HasOne (α : Type u) := OfNat α (natLit! 1)
|
||||
abbrev HasOne (α : Type u) := OfNat α (nat_lit 1)
|
||||
|
||||
def one' (α : Type u) [HasOne α] : α := 1
|
||||
|
||||
|
|
|
|||
|
|
@ -4,19 +4,19 @@ Helper classes for Lean 3 users
|
|||
class One (α : Type u) where
|
||||
one : α
|
||||
|
||||
instance [OfNat α (natLit! 1)] : One α where
|
||||
instance [OfNat α (nat_lit 1)] : One α where
|
||||
one := 1
|
||||
|
||||
instance [One α] : OfNat α (natLit! 1) where
|
||||
instance [One α] : OfNat α (nat_lit 1) where
|
||||
ofNat := One.one
|
||||
|
||||
class Zero (α : Type u) where
|
||||
zero : α
|
||||
|
||||
instance [OfNat α (natLit! 0)] : Zero α where
|
||||
instance [OfNat α (nat_lit 0)] : Zero α where
|
||||
zero := 0
|
||||
|
||||
instance [Zero α] : OfNat α (natLit! 0) where
|
||||
instance [Zero α] : OfNat α (nat_lit 0) where
|
||||
ofNat := Zero.zero
|
||||
|
||||
/- Simple Matrix -/
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ by {
|
|||
theorem simple7 (x y z : Nat) : y = z → x = x → x = y → x = z :=
|
||||
by {
|
||||
intro h1; intro _; intro h3;
|
||||
refine! Eq.trans ?pre ?post;
|
||||
refine' Eq.trans ?pre ?post;
|
||||
exact y;
|
||||
{ exact h3 }
|
||||
{ exact h1 }
|
||||
|
|
@ -102,7 +102,7 @@ by {
|
|||
|
||||
theorem simple8 (x y z : Nat) : y = z → x = x → x = y → x = z := by
|
||||
intro h1; intro _; intro h3
|
||||
refine! Eq.trans ?pre ?post
|
||||
refine' Eq.trans ?pre ?post
|
||||
case post => exact h1
|
||||
case pre => exact h3
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ theorem simple9 (x y z : Nat) : y = z → x = x → x = y → x = z := by
|
|||
intros h1 _ h3
|
||||
traceState
|
||||
focus
|
||||
refine! Eq.trans ?pre ?post
|
||||
refine' Eq.trans ?pre ?post
|
||||
first
|
||||
| exact h1
|
||||
assumption
|
||||
|
|
@ -122,7 +122,7 @@ theorem simple9b (x y z : Nat) : y = z → x = x → x = y → x = z := by
|
|||
intros h1 _ h3
|
||||
traceState
|
||||
focus
|
||||
refine! Eq.trans ?pre ?post
|
||||
refine' Eq.trans ?pre ?post
|
||||
first
|
||||
| exact h1
|
||||
| exact y; exact h3
|
||||
|
|
@ -132,12 +132,12 @@ theorem simple9c (x y z : Nat) : y = z → x = x → x = y → x = z := by
|
|||
intros h1 _ h3
|
||||
solve
|
||||
| exact h1
|
||||
| refine! Eq.trans ?pre ?post; exact y; exact h3; assumption
|
||||
| refine' Eq.trans ?pre ?post; exact y; exact h3; assumption
|
||||
| exact h3
|
||||
|
||||
theorem simple9d (x y z : Nat) : y = z → x = x → x = y → x = z := by
|
||||
intros h1 _ h3
|
||||
refine! Eq.trans ?pre ?post
|
||||
refine' Eq.trans ?pre ?post
|
||||
solve
|
||||
| exact h1
|
||||
| exact y
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ class Zero (α : Type u) where
|
|||
class One (α : Type u) where
|
||||
one : α
|
||||
|
||||
instance [Zero α] : OfNat α (natLit! 0) where
|
||||
instance [Zero α] : OfNat α (nat_lit 0) where
|
||||
ofNat := Zero.zero
|
||||
|
||||
instance [One α] : OfNat α (natLit! 1) where
|
||||
instance [One α] : OfNat α (nat_lit 1) where
|
||||
ofNat := One.one
|
||||
|
||||
-- Some example structure
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ def BV (n : Nat) := { a : Array Bool // a.size = n }
|
|||
axiom foo {n m : Nat} (a : BV n) (b : BV m) : BV (n - m)
|
||||
|
||||
def test (x1 : BV 30002) (x2 : BV 30001) (y1 : BV 60004) (y2 : BV 60003) : Prop :=
|
||||
foo x1 x2 = withoutExpectedType! foo y1 y2
|
||||
foo x1 x2 = without_expected_type foo y1 y2
|
||||
|
||||
@[elabWithoutExpectedType]
|
||||
axiom foo2 {n m : Nat} (a : BV n) (b : BV m) : BV (n - m)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue