@@ -124,12 +124,12 @@ example (n : ℕ) : foo.rfl.invFun n = n := by rw [foo.rfl_invFun]
124
124
-- note: in Lean 4 the first test succeeds without `@[simps]`, however, the remaining tests don't
125
125
example : foo.1 = 1 := by simp
126
126
example {a : ℕ} {h : 1 = a} : foo.1 = a := by rw [foo_fst, h]
127
- example {a : ℕ} {h : 1 = a} : foo.1 = a := by simp <;> rw [h]
128
- example {a : ℤ} {h : 2 = a} : foo.2 = a := by simp <;> rw [h]
129
- example {a : ℕ} {h : 1 = a} : foo.1 = a := by dsimp <;> rw [h] -- check that dsimp also unfolds
130
- example {a : ℤ} {h : 2 = a} : foo.2 = a := by dsimp <;> rw [h]
131
- example {α} (x y : α) (h : x = y) : foo.rfl.toFun x = y := by simp <;> rw [h]
132
- example {α} (x y : α) (h : x = y) : foo.rfl.invFun x = y := by simp <;> rw [h]
127
+ example {a : ℕ} {h : 1 = a} : foo.1 = a := by simp; rw [h]
128
+ example {a : ℤ} {h : 2 = a} : foo.2 = a := by simp; rw [h]
129
+ example {a : ℕ} {h : 1 = a} : foo.1 = a := by dsimp; rw [h] -- check that dsimp also unfolds
130
+ example {a : ℤ} {h : 2 = a} : foo.2 = a := by dsimp; rw [h]
131
+ example {α} (x y : α) (h : x = y) : foo.rfl.toFun x = y := by simp; rw [h]
132
+ example {α} (x y : α) (h : x = y) : foo.rfl.invFun x = y := by simp; rw [h]
133
133
-- example {α} (x y : α) (h : x = y) : foo.rfl.toFun = @id α := by { successIfFail {simp}, rfl }
134
134
135
135
/- check some failures -/
@@ -367,8 +367,8 @@ example {α} {b : Bool} {x} (h : (⟨3, 5⟩ : MyProd _ _) = x) : (@test α).ext
367
367
@[simps (config := {simpRhs := true})] def Equiv'.trans {α β γ} (f : α ≃ β) (g : β ≃ γ) : α ≃ γ :=
368
368
⟨ g.toFun ∘ f.toFun,
369
369
f.invFun ∘ g.invFun,
370
- (by intro x <;> simp [Equiv'.left_inv _ _]),
371
- (by intro x <;> simp [Equiv'.right_inv _ _])⟩
370
+ (by intro x; simp [Equiv'.left_inv _ _]),
371
+ (by intro x; simp [Equiv'.right_inv _ _])⟩
372
372
373
373
374
374
example {α β γ : Type } (f : α ≃ β) (g : β ≃ γ) (x : α) {z : γ} (h : g.toFun (f.toFun x) = z) :
@@ -378,13 +378,13 @@ example {α β γ : Type} (f : α ≃ β) (g : β ≃ γ) (x : α) {z : γ} (h :
378
378
379
379
attribute [local simp] Nat.zero_add Nat.one_mul Nat.mul_one
380
380
@[simps (config := {simpRhs := true})] def myNatEquiv : ℕ ≃ ℕ :=
381
- ⟨λ n => 0 + n, λ n => 1 * n * 1 , by intro n <;> simp, by intro n <;> simp⟩
381
+ ⟨λ n => 0 + n, λ n => 1 * n * 1 , by intro n; simp, by intro n; simp⟩
382
382
383
383
example (n : ℕ) : myNatEquiv.toFun (myNatEquiv.toFun $ myNatEquiv.invFun n) = n :=
384
384
by { /-successIfFail { rfl },-/ simp only [myNatEquiv_toFun, myNatEquiv_invFun] }
385
385
386
386
@[simps (config := {simpRhs := true})] def succeed_without_simplification_possible : ℕ ≃ ℕ :=
387
- ⟨λ n => n, λ n => n, by intro n <;> rfl, by intro n <;> rfl⟩
387
+ ⟨λ n => n, λ n => n, by intro n; rfl, by intro n; rfl⟩
388
388
389
389
390
390
/- test that we don't recursively take projections of `prod` and `PProd` -/
@@ -437,10 +437,10 @@ infixr:80 " ≫ " => CategoryStruct.comp -- type as \gg
437
437
438
438
@[ext] theorem types.ext {X Y : Type u} {f g : X ⟶ Y} : (∀ x, f x = g x) → f = g := funext
439
439
440
- example (X : Type u) {x : Type u} (h : (X → X) = x) : (X ⟶ X) = x := by simp <;> rw [h]
441
- example (X : Type u) {f : X → X} (h : ∀ x, f x = x) : 𝟙 X = f := by ext <;> simp <;> rw [h]
440
+ example (X : Type u) {x : Type u} (h : (X → X) = x) : (X ⟶ X) = x := by simp; rw [h]
441
+ example (X : Type u) {f : X → X} (h : ∀ x, f x = x) : 𝟙 X = f := by ext; simp; rw [h]
442
442
example (X Y Z : Type u) (f : X ⟶ Y) (g : Y ⟶ Z) {k : X → Z} (h : ∀ x, g (f x) = k x) :
443
- f ≫ g = k := by ext <;> simp <;> rw [h]
443
+ f ≫ g = k := by ext; simp; rw [h]
444
444
445
445
namespace coercing
446
446
@@ -453,8 +453,8 @@ instance : CoeSort FooStr Type := ⟨FooStr.c⟩
453
453
@[simps] def foo : FooStr := ⟨ℕ, 3 ⟩
454
454
@[simps] def foo2 : FooStr := ⟨ℕ, 34 ⟩
455
455
456
- example {x : Type } (h : ℕ = x) : foo = x := by simp only [foo_c] <;> rw [h]
457
- example {x : ℕ} (h : (3 : ℕ) = x) : foo.x = x := by simp only [foo_x] <;> rw [h]
456
+ example {x : Type } (h : ℕ = x) : foo = x := by simp only [foo_c]; rw [h]
457
+ example {x : ℕ} (h : (3 : ℕ) = x) : foo.x = x := by simp only [foo_x]; rw [h]
458
458
459
459
structure VooStr (n : ℕ) :=
460
460
(c : Type )
@@ -465,8 +465,8 @@ instance (n : ℕ) : CoeSort (VooStr n) Type := ⟨VooStr.c⟩
465
465
@[simps] def voo : VooStr 7 := ⟨ℕ, 3 ⟩
466
466
@[simps] def voo2 : VooStr 4 := ⟨ℕ, 34 ⟩
467
467
468
- example {x : Type } (h : ℕ = x) : voo = x := by simp only [voo_c] <;> rw [h]
469
- example {x : ℕ} (h : (3 : ℕ) = x) : voo.x = x := by simp only [voo_x] <;> rw [h]
468
+ example {x : Type } (h : ℕ = x) : voo = x := by simp only [voo_c]; rw [h]
469
+ example {x : ℕ} (h : (3 : ℕ) = x) : voo.x = x := by simp only [voo_x]; rw [h]
470
470
471
471
structure Equiv2 (α : Sort _) (β : Sort _) :=
472
472
(toFun : α → β)
@@ -480,8 +480,8 @@ instance {α β} : CoeFun (Equiv2 α β) (λ _ => α → β) := ⟨Equiv2.toFun
480
480
⟨λ x => x, λ x => x, λ _ => rfl, λ _ => rfl⟩
481
481
482
482
example {α} (x x' : α) (h : x = x') : coercing.rfl2 x = x' := by rw [coercing.rfl2_toFun, h]
483
- example {α} (x x' : α) (h : x = x') : coercing.rfl2 x = x' := by simp <;> rw [h]
484
- example {α} (x x' : α) (h : x = x') : coercing.rfl2.invFun x = x' := by simp <;> rw [h]
483
+ example {α} (x x' : α) (h : x = x') : coercing.rfl2 x = x' := by simp; rw [h]
484
+ example {α} (x x' : α) (h : x = x') : coercing.rfl2.invFun x = x' := by simp; rw [h]
485
485
486
486
@[simps] protected def Equiv2.symm {α β} (f : Equiv2 α β) : Equiv2 β α :=
487
487
⟨f.invFun, f, f.right_inv, f.left_inv⟩
@@ -492,12 +492,12 @@ example {α} (x x' : α) (h : x = x') : coercing.rfl2.invFun x = x' := by simp <
492
492
@[simps (config := {fullyApplied := false})] protected def Equiv2.symm3 {α β} (f : Equiv2 α β) : Equiv2 β α :=
493
493
⟨f.invFun, f, f.right_inv, f.left_inv⟩
494
494
495
- example {α β} (f : Equiv2 α β) (y : β) {x} (h : f.invFun y = x) : f.symm y = x := by simp <;> rw [h]
496
- example {α β} (f : Equiv2 α β) (x : α) {z} (h : f x = z) : f.symm.invFun x = z := by simp <;> rw [h]
495
+ example {α β} (f : Equiv2 α β) (y : β) {x} (h : f.invFun y = x) : f.symm y = x := by simp; rw [h]
496
+ example {α β} (f : Equiv2 α β) (x : α) {z} (h : f x = z) : f.symm.invFun x = z := by simp; rw [h]
497
497
498
498
-- example {α β} (f : Equiv2 α β) {x} (h : f = x) : f.symm.invFun = x :=
499
499
-- by { /-successIfFail {simp <;> rw [ h ] } <;>-/ rfl }
500
- example {α β} (f : Equiv2 α β) {x} (h : f = x) : f.symm3.invFun = x := by simp <;> rw [h]
500
+ example {α β} (f : Equiv2 α β) {x} (h : f = x) : f.symm3.invFun = x := by simp; rw [h]
501
501
502
502
class Semigroup (G : Type u) extends Mul G where
503
503
mul_assoc : ∀ a b c : G, a * b * c = a * (b * c)
@@ -587,7 +587,7 @@ protected def Equiv.trans (e₁ : α ≃ β) (e₂ : β ≃ γ) : α ≃ γ :=
587
587
588
588
example (e₁ : α ≃ β) (e₂ : β ≃ γ) (x : γ) {z} (h : e₁.symm (e₂.symm x) = z) :
589
589
(e₁.trans e₂).symm x = z :=
590
- by simp only [Equiv.trans_invFun] <;> rw [h]
590
+ by simp only [Equiv.trans_invFun]; rw [h]
591
591
592
592
end ManualCoercion
593
593
@@ -641,7 +641,7 @@ protected def Equiv.trans (e₁ : α ≃ β) (e₂ : β ≃ γ) : α ≃ γ :=
641
641
642
642
example (e₁ : α ≃ β) (e₂ : β ≃ γ) (x : γ) {z} (h : e₁.symm (e₂.symm x) = z) :
643
643
(e₁.trans e₂).symm x = z :=
644
- by simp only [Equiv.trans_invFun] <;> rw [h]
644
+ by simp only [Equiv.trans_invFun]; rw [h]
645
645
646
646
end ManualInitialize
647
647
@@ -725,11 +725,11 @@ protected def Equiv.trans (e₁ : α ≃ β) (e₂ : β ≃ γ) : α ≃ γ :=
725
725
⟨e₂ ∘ (e₁ : α → β), e₁.symm ∘ (e₂.symm : γ → β)⟩
726
726
727
727
example (e₁ : α ≃ β) (e₂ : β ≃ γ) (x : α) {z} (h : e₂ (e₁ x) = z) : (e₁.trans e₂) x = z :=
728
- by simp only [Equiv.trans_apply] <;> rw [h]
728
+ by simp only [Equiv.trans_apply]; rw [h]
729
729
730
730
example (e₁ : α ≃ β) (e₂ : β ≃ γ) (x : γ) {z} (h : e₁.symm (e₂.symm x) = z) :
731
731
(e₁.trans e₂).symm x = z :=
732
- by simp only [Equiv.trans_symm_apply] <;> rw [h]
732
+ by simp only [Equiv.trans_symm_apply]; rw [h]
733
733
734
734
-- the new projection names are parsed correctly (the old projection names won't work anymore)
735
735
@[simps apply symm_apply] protected def Equiv.trans2 (e₁ : α ≃ β) (e₂ : β ≃ γ) : α ≃ γ :=
@@ -1110,8 +1110,7 @@ initialize_simps_projections OneMore
1110
1110
Q_toFun := λ y => ⟨y, rfl⟩
1111
1111
Q_invFun := λ y => ⟨y, rfl⟩ }
1112
1112
1113
- example {α : Type } (x : α) : (fffoo α).symm x = x :=
1114
- by dsimp <;> guard_target = x = x <;> rfl
1113
+ example {α : Type } (x : α) : (fffoo α).symm x = x := by dsimp
1115
1114
1116
1115
@[simps apply to_dequiv_apply toFurtherDecoratedEquiv_apply to_dequiv]
1117
1116
def fffoo2 (α : Type ) : OneMore α α := fffoo α
0 commit comments