@@ -143,7 +143,7 @@ section
143143
144144/-- A family of equivalences `∀ a, β₁ a ≃ β₂ a` generates an equivalence between `∀ a, β₁ a` and
145145`∀ a, β₂ a`. -/
146- @[simps]
146+ @[simps (attr := grind =) ]
147147def piCongrRight {β₁ β₂ : α → Sort *} (F : ∀ a, β₁ a ≃ β₂ a) : (∀ a, β₁ a) ≃ (∀ a, β₂ a) :=
148148 ⟨Pi.map fun a ↦ F a, Pi.map fun a ↦ (F a).symm, fun H => funext <| by simp,
149149 fun H => funext <| by simp⟩
@@ -671,21 +671,20 @@ theorem symm_swap (a b : α) : (swap a b).symm = swap a b :=
671671 rfl
672672
673673@[simp]
674- theorem swap_eq_refl_iff {x y : α} : swap x y = Equiv.refl _ ↔ x = y := by
675- refine ⟨fun h => (Equiv.refl _).injective ?_, fun h => h ▸ swap_self _⟩
676- rw [← h, swap_apply_left, h, refl_apply]
674+ theorem swap_eq_refl_iff {x y : α} : swap x y = Equiv.refl _ ↔ x = y :=
675+ ⟨fun h => (Equiv.refl _).injective (by grind), by grind⟩
677676
678677theorem swap_comp_apply {a b x : α} (π : Perm α) :
679678 π.trans (swap a b) x = if π x = a then b else if π x = b then a else π x := by
680679 cases π
681680 rfl
682681
683682theorem swap_eq_update (i j : α) : (Equiv.swap i j : α → α) = update (update id j i) i j := by
684- aesop
683+ grind
685684
686685theorem comp_swap_eq_update (i j : α) (f : α → β) :
687686 f ∘ Equiv.swap i j = update (update f j (f i)) i (f j) := by
688- aesop
687+ grind
689688
690689@[simp]
691690theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
@@ -699,15 +698,15 @@ theorem trans_swap_trans_symm [DecidableEq β] (a b : β) (e : α ≃ β) :
699698
700699@[simp]
701700theorem swap_apply_self (i j a : α) : swap i j (swap i j a) = a := by
702- rw [← Equiv.trans_apply, Equiv.swap_swap, Equiv.refl_apply]
701+ grind
703702
704703/-- A function is invariant to a swap if it is equal at both elements -/
705704theorem apply_swap_eq_self {v : α → β} {i j : α} (hv : v i = v j) (k : α) :
706705 v (swap i j k) = v k := by
707706 grind
708707
709708theorem swap_apply_eq_iff {x y z w : α} : swap x y z = w ↔ z = swap x y w := by
710- rw [apply_eq_iff_eq_symm_apply, symm_swap]
709+ grind
711710
712711theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
713712 grind
@@ -768,9 +767,10 @@ theorem Function.Injective.map_swap [DecidableEq α] [DecidableEq β] {f : α
768767 f (Equiv.swap x y z) = Equiv.swap (f x) (f y) (f z) := by
769768 conv_rhs => rw [Equiv.swap_apply_def]
770769 split_ifs with h₁ h₂
771- · rw [hf h₁, Equiv.swap_apply_left]
770+ · -- We can't yet use `grind` here because of https://github.com/leanprover/lean4/issues/11088
771+ rw [hf h₁, Equiv.swap_apply_left]
772772 · rw [hf h₂, Equiv.swap_apply_right]
773- · rw [Equiv.swap_apply_of_ne_of_ne (mt (congr_arg f) h₁) (mt (congr_arg f) h₂)]
773+ · grind
774774
775775namespace Equiv
776776
@@ -827,7 +827,7 @@ lemma piCongrLeft_apply (f : ∀ a, P (e a)) (b : β) :
827827 (piCongrLeft P e) f b = e.apply_symm_apply b ▸ f (e.symm b) :=
828828 rfl
829829
830- @[simp]
830+ @[simp, grind = ]
831831lemma piCongrLeft_symm_apply (g : ∀ b, P b) (a : α) :
832832 (piCongrLeft P e).symm g a = g (e a) :=
833833 piCongrLeft'_apply P e.symm g a
@@ -840,7 +840,7 @@ lemma piCongrLeft_refl (P : α → Sort*) : piCongrLeft P (.refl α) = .refl (
840840LHS would have type `P b` while the RHS would have type `P (e (e.symm b))`. This lemma is a way
841841around it in the case where `b` is of the form `e a`, so we can use `f a` instead of
842842`f (e.symm (e a))`. -/
843- @[simp]
843+ @[simp, grind = ]
844844lemma piCongrLeft_apply_apply (f : ∀ a, P (e a)) (a : α) :
845845 (piCongrLeft P e) f (e a) = f a :=
846846 piCongrLeft'_symm_apply_apply P e.symm f a
@@ -855,12 +855,12 @@ lemma piCongrLeft_apply_eq_cast {P : β → Sort v} {e : α ≃ β}
855855theorem piCongrLeft_sumInl {ι ι' ι''} (π : ι'' → Type *) (e : ι ⊕ ι' ≃ ι'') (f : ∀ i, π (e (inl i)))
856856 (g : ∀ i, π (e (inr i))) (i : ι) :
857857 piCongrLeft π e (sumPiEquivProdPi (fun x => π (e x)) |>.symm (f, g)) (e (inl i)) = f i := by
858- aesop
858+ grind
859859
860860theorem piCongrLeft_sumInr {ι ι' ι''} (π : ι'' → Type *) (e : ι ⊕ ι' ≃ ι'') (f : ∀ i, π (e (inl i)))
861861 (g : ∀ i, π (e (inr i))) (j : ι') :
862862 piCongrLeft π e (sumPiEquivProdPi (fun x => π (e x)) |>.symm (f, g)) (e (inr j)) = g j := by
863- aesop
863+ grind
864864
865865end
866866
@@ -876,18 +876,18 @@ def piCongr : (∀ a, W a) ≃ ∀ b, Z b :=
876876 (Equiv.piCongrRight h₂).trans (Equiv.piCongrLeft _ h₁)
877877
878878@[simp]
879- theorem coe_piCongr_symm : ((h₁.piCongr h₂).symm :
880- (∀ b, Z b) → ∀ a, W a) = fun f a => (h₂ a).symm (f (h₁ a)) :=
879+ theorem coe_piCongr_symm :
880+ ((h₁.piCongr h₂).symm : ( ∀ b, Z b) → ∀ a, W a) = fun f a => (h₂ a).symm (f (h₁ a)) :=
881881 rfl
882882
883- @[simp]
883+ @[simp, grind = ]
884884theorem piCongr_symm_apply (f : ∀ b, Z b) :
885885 (h₁.piCongr h₂).symm f = fun a => (h₂ a).symm (f (h₁ a)) :=
886886 rfl
887887
888- @[simp]
888+ @[simp, grind = ]
889889theorem piCongr_apply_apply (f : ∀ a, W a) (a : α) : h₁.piCongr h₂ f (h₁ a) = h₂ a (f a) := by
890- simp only [piCongr, piCongrRight, trans_apply, coe_fn_mk, piCongrLeft_apply_apply , Pi.map_apply]
890+ rw [piCongr, trans_apply, piCongrLeft_apply_apply, piCongrRight_apply , Pi.map_apply]
891891
892892end
893893
0 commit comments