Skip to content

Commit 4576e6e

Browse files
committed
feat: last adaptations for v4.31.0 (#229)
Sorry, automated processes fell apart at the last moment.
1 parent f58ed90 commit 4576e6e

26 files changed

Lines changed: 64 additions & 44 deletions

File tree

Mathlib/Algebra/Category/AlgCat/FilteredColimits.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ section
3131

3232
variable {c : Cocone (F ⋙ forget₂ _ RingCat)} [IsFilteredOrEmpty J]
3333

34+
set_option backward.defeqAttrib.useBackward true in
3435
set_option backward.isDefEq.respectTransparency false in
3536
/-- (Implementation): The algebra instance on the cocone point of the underlying diagram of rings
3637
is induced from the `j`-th inclusion map. Any choice of `j` gives a propositionally equal algebra
@@ -41,6 +42,7 @@ private abbrev AlgCat.algebraOfIsFiltered (hc : IsColimit c) (j : J) : Algebra R
4142
obtain ⟨k, hjk, y, rfl⟩ := Concrete.exists_hom_ι_eq_of_isColimit _ hc x j
4243
simp [← dsimp% c.w hjk, ← dsimp% (c.ι.app k).hom.map_mul, Algebra.commutes']
4344

45+
set_option backward.defeqAttrib.useBackward true in
4446
set_option backward.isDefEq.respectTransparency false in
4547
/-- The cocone of the underlying diagram of rings lifted to `AlgCat R`. The algebra instance
4648
on the cocone point is induced from the `j`-th inclusion map. -/
@@ -57,6 +59,7 @@ private def AlgCat.coconeOfIsFiltered (hc : IsColimit c) (j : J) : Cocone F wher
5759
ext
5860
exact c.ι.naturality_apply _ _
5961

62+
set_option backward.defeqAttrib.useBackward true in
6063
set_option backward.isDefEq.respectTransparency false in
6164
/-- The lifted cocone is colimiting. -/
6265
private def AlgCat.isColimitCoconeOfIsFiltered (hc : IsColimit c) (j : J) :

Mathlib/Algebra/Exact/Sequence.lean

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,23 @@ public lemma sum_neg_one_pow_finrank_eq_zero_of_exact {n : ℕ} (V : Fin (n + 2)
4848
simp_rw [← smul_eq_mul]
4949
refine Fin.sum_neg_one_pow_eq_zero _ (fun i ↦ finrank k (f i).range) ?_ (fun i ↦ ?_) ?_
5050
· aesop
51-
· grind [(h_exact i).linearMap_ker_eq, (f i.succ).finrank_range_add_finrank_ker]
52-
· grind [finrank_top]
51+
· #adaptation_note /-- Prior to v4.31.0-rc1, this proof was
52+
```
53+
grind [(h_exact i).linearMap_ker_eq, (f i.succ).finrank_range_add_finrank_ker]
54+
```
55+
-/
56+
have hrn := (f i.succ).finrank_range_add_finrank_ker
57+
have hker : finrank k ↥(LinearMap.ker (f i.succ)) =
58+
finrank k ↥(LinearMap.range (f i.castSucc)) :=
59+
congrArg (fun S : Submodule k (V i.succ.castSucc) => finrank k ↥S)
60+
(h_exact i).linearMap_ker_eq
61+
omega
62+
· #adaptation_note /-- Prior to v4.31.0-rc1, this proof was
63+
```
64+
grind [finrank_top]
65+
```
66+
-/
67+
rw [surj, finrank_top, Fin.succ_last]
5368

5469
/- An unrolled version of `Module.sum_neg_one_pow_finrank_eq_zero_of_exact`. This is an auxiliary
5570
lemma en route to `Module.sum_neg_one_pow_finrank_eq_zero_of_exact_six`. -/
@@ -78,7 +93,7 @@ private lemma sum_neg_one_pow_finrank_eq_zero_of_exact_six_aux {V₀ V₁ V₂ V
7893
| 0 => ‹_› | 1 => ‹_› | 2 => ‹_› | 3 => ‹_› | 4 => ‹_› | 5 => ‹_›
7994
letI fs (i : Fin 5) : Vs i.castSucc →ₗ[k] Vs i.succ := match i with
8095
| 0 => f₀ | 1 => f₁ | 2 => f₂ | 3 => f₃ | 4 => f₄
81-
simpa [Fin.sum_univ_six] using Module.sum_neg_one_pow_finrank_eq_zero_of_exact Vs fs inj
96+
simpa [Fin.sum_univ_six] using! Module.sum_neg_one_pow_finrank_eq_zero_of_exact Vs fs inj
8297
(fun i ↦ by fin_cases i; exacts [exact₁, exact₂, exact₃, exact₄]) surj
8398

8499
/-- This is an unrolled, universe-polymorphic version of

Mathlib/AlgebraicGeometry/Birational/Dominant.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace Scheme
3434

3535
namespace PartialMap
3636

37+
set_option backward.defeqAttrib.useBackward true in
3738
/-- Restricting a dominant partial map to a dense open yields a dominant partial map. -/
3839
lemma isDominant_restrict_hom (f : X.PartialMap Y) [IsDominant f.hom] (U : X.Opens)
3940
(hU : Dense (U : Set X)) (hU' : U ≤ f.domain) : IsDominant (f.restrict U hU hU').hom := by
@@ -54,6 +55,7 @@ lemma isDominant_hom_iff_isDominant_restrict_hom (f : X.PartialMap Y) (U : X.Ope
5455
fun _ ↦ f.isDominant_restrict_hom U hU hU',
5556
fun _ ↦ f.isDominant_hom_of_isDominant_restrict_hom U hU hU'⟩
5657

58+
set_option backward.defeqAttrib.useBackward true in
5759
/-- Dominance of the underlying morphism is invariant under equivalence of partial maps. -/
5860
lemma isDominant_hom_iff_of_equiv (f g : X.PartialMap Y) (h : f.equiv g) :
5961
IsDominant f.hom ↔ IsDominant g.hom := by

Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ theorem d_squared (n : ℕ) : objD X (n + 1) ≫ objD X n = 0 := by
101101
simp_rw [S, Finset.compl_filter, Finset.mem_filter_univ, not_le] at hij'
102102
refine ⟨(j'.pred <| ?_, Fin.castSucc i'), ?_, ?_⟩
103103
· rintro rfl
104-
simp only [Fin.val_zero, not_lt_zero'] at hij'
104+
simp only [Fin.val_zero, not_lt_zero] at hij'
105105
· simpa [S] using! Nat.le_sub_one_of_lt hij'
106106
· simp only [φ, Fin.castLT_castSucc, Fin.succ_pred]
107107
· -- identification of corresponding terms in both sums

Mathlib/Analysis/Calculus/IteratedDeriv/Analytic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ lemma iteratedDeriv_mul_pow_sub_of_analytic {k t : ℕ} {z₀ : 𝕜} {R R₁ :
4545
(z - z₀) ^ (t + 1) * ((k + (t + 1))! / (t + 1)! * deriv R₁ z +
4646
(R₂ z + (z - z₀) * deriv R₂ z)) := by
4747
have hsub : HasDerivAt (· - z₀) 1 z := (hasDerivAt_id z).sub_const z₀
48-
simpa using ((hsub.fun_pow (t + 1)).mul
48+
simpa using! ((hsub.fun_pow (t + 1)).mul
4949
(((hf1 z).differentiableAt.hasDerivAt.const_mul ((k + (t + 1))! / (t + 1)! : 𝕜)).add
5050
(hsub.mul (hR₂ z).differentiableAt.hasDerivAt))).deriv
5151
_ = (z - z₀) ^ t * ((k + 1 + t)! / t ! * R₁ z + (z - z₀) * R₂' z) := by

Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ lemma hasPointwiseRightKanExtensionAt_iff_of_equivalence
160160
isoWhiskerLeft L E.unitIso.symm ≪≫ L.rightUnitor) Y' Y
161161
(E.inverse.mapIso e.symm ≪≫ E.unitIso.symm.app Y)
162162

163+
set_option backward.defeqAttrib.useBackward true in
163164
lemma HasPointwiseLeftKanExtensionAt.of_natIso {L L' : C ⥤ D} {F F' : C ⥤ H} (Y : D)
164165
[L.HasPointwiseLeftKanExtensionAt F Y] (e₁ : L ≅ L') (e₂ : F ≅ F') :
165166
L'.HasPointwiseLeftKanExtensionAt F' Y := by
@@ -176,6 +177,7 @@ lemma hasPointwiseLeftKanExtensionAt_iff_of_natIso {L L' : C ⥤ D} {F F' : C
176177
L.HasPointwiseLeftKanExtensionAt F Y ↔ L'.HasPointwiseLeftKanExtensionAt F' Y :=
177178
fun _ ↦ .of_natIso Y e₁ e₂, fun _ ↦ .of_natIso Y e₁.symm e₂.symm⟩
178179

180+
set_option backward.defeqAttrib.useBackward true in
179181
lemma HasPointwiseRightKanExtensionAt.of_natIso {L L' : C ⥤ D} {F F' : C ⥤ H} (Y : D)
180182
[L.HasPointwiseRightKanExtensionAt F Y] (e₁ : L ≅ L') (e₂ : F ≅ F') :
181183
L'.HasPointwiseRightKanExtensionAt F' Y := by

Mathlib/CategoryTheory/Limits/ConcreteCategory/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ theorem colimit_rep_eq_iff_exists [HasColimit F] {i j : J} (x : ToType (F.obj i)
188188
colimit.ι F i x = colimit.ι F j y ↔ ∃ (k : _) (f : i ⟶ k) (g : j ⟶ k), F.map f x = F.map g y :=
189189
⟨Concrete.colimit_exists_of_rep_eq.{s} _ _ _, Concrete.colimit_rep_eq_of_exists _ _ _⟩
190190

191+
set_option backward.defeqAttrib.useBackward true in
191192
omit [IsFiltered J] in
192193
theorem exists_hom_ι_eq_of_isColimit [IsFilteredOrEmpty J] {D : Cocone F} (hD : IsColimit D)
193194
(x : ToType D.pt) (k : J) :

Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ def normalizeIsoApp' :
204204
@[simp] theorem normalizeIsoApp'_unit (n : NormalMonoidalObject C) :
205205
normalizeIsoApp' C (𝟙_ (F C)) n = ρ_ _ := rfl
206206

207+
set_option backward.defeqAttrib.useBackward true in
207208
theorem normalizeIsoApp_eq :
208209
∀ (X : F C) (n : N C), normalizeIsoApp C X n = normalizeIsoApp' C X n.as
209210
| of _, _ => rfl
@@ -279,6 +280,7 @@ theorem normalize_naturality (n : NormalMonoidalObject C) {X Y : F C} (f : X ⟶
279280

280281
end
281282

283+
set_option backward.defeqAttrib.useBackward true in
282284
/-- The isomorphism between `n ⊗ X` and `normalize X n` is natural (in both `X` and `n`, but
283285
naturality in `n` is trivial and was "proved" in `normalizeIsoAux`). This is the real heart
284286
of our proof of the coherence theorem. -/

Mathlib/CategoryTheory/MorphismProperty/LocalEpi.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def localEpi (P : ObjectProperty C) : MorphismProperty C := fun _ _ f ↦
4747
∀ ⦃Z⦄, P Z → Function.Injective fun (g : _ ⟶ Z) ↦ f ≫ g
4848

4949
instance : P.localEpi.IsMultiplicative where
50-
id_mem X Z _ := by simpa using Function.injective_id
50+
id_mem X Z _ := by simpa using! Function.injective_id
5151
comp_mem f g hf hg T hT _ _ huv := hg hT (hf hT <| by simpa using huv)
5252

5353
lemma localEpi.of_epi {X Y : C} (f : X ⟶ Y) [Epi f] : P.localEpi f := by
@@ -101,6 +101,7 @@ variable {D : Type*} [Category* D] {F : C ⥤ D} {G : D ⥤ C} (adj : F ⊣ G)
101101
[G.Faithful] [G.Full]
102102
include adj
103103

104+
set_option backward.isDefEq.respectTransparency false in
104105
lemma localEpi_mem_range_iff_epi {X Y : C} (f : X ⟶ Y) :
105106
localEpi (· ∈ Set.range G.obj) f ↔ Epi (F.map f) := by
106107
rw [← dsimp% (localEpi (· ∈ Set.range G.obj)).postcomp_iff _ _ (isLocal_adj_unit_app adj Y),

Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def Over.mapCongr [Q.RespectsIso] {X Y : T} {f g : X ⟶ Y} (hfg : f = g) (hf :
5858
NatIso.ofComponents (fun Y ↦ Over.isoMk (Iso.refl _))
5959

6060
set_option backward.defeqAttrib.useBackward true in
61+
set_option linter.overlappingInstances false in
6162
/-- `Over.map` preserves identities. -/
6263
@[simps!]
6364
def Over.mapId [P.IsMultiplicative] [Q.RespectsIso] (X : T) (f : X ⟶ X := 𝟙 X)
@@ -237,6 +238,7 @@ def Under.mapCongr [Q.RespectsIso] {X Y : T} {f g : X ⟶ Y} (hfg : f = g) (hf :
237238
NatIso.ofComponents (fun Y ↦ Under.isoMk (Iso.refl _))
238239

239240
set_option backward.defeqAttrib.useBackward true in
241+
set_option linter.overlappingInstances false in
240242
/-- `Under.map` preserves identities. -/
241243
@[simps!]
242244
def Under.mapId [P.IsMultiplicative] [Q.RespectsIso] (X : T) (f : X ⟶ X := 𝟙 X)

0 commit comments

Comments
 (0)