Skip to content

Commit 07e9996

Browse files
Parcly-Taxeljoelriou
authored andcommitted
chore: deprime induction in AlgebraicTopology/CategoryTheory (leanprover-community#25774)
Most replacements that are also in leanprover-community#23676 have been copied over, but some have been optimised further. Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
1 parent 048ea61 commit 07e9996

File tree

28 files changed

+133
-124
lines changed

28 files changed

+133
-124
lines changed

Mathlib/AlgebraicTopology/DoldKan/Decomposition.lean

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ the $y_i$ are in degree $n$. -/
5050
theorem decomposition_Q (n q : ℕ) :
5151
((Q q).f (n + 1) : X _⦋n + 1⦌ ⟶ X _⦋n + 1⦌) =
5252
∑ i : Fin (n + 1) with i.val < q, (P i).f (n + 1) ≫ X.δ i.rev.succ ≫ X.σ (Fin.rev i) := by
53-
induction' q with q hq
54-
· simp only [Q_zero, HomologicalComplex.zero_f_apply, Nat.not_lt_zero,
53+
induction q with
54+
| zero =>
55+
simp only [Q_zero, HomologicalComplex.zero_f_apply, Nat.not_lt_zero,
5556
Finset.filter_false, Finset.sum_empty]
56-
· by_cases hqn : q + 1 ≤ n + 1
57+
| succ q hq =>
58+
by_cases hqn : q + 1 ≤ n + 1
5759
swap
5860
· rw [Q_is_eventually_constant (show n + 1 ≤ q by omega), hq]
5961
congr 1

Mathlib/AlgebraicTopology/DoldKan/Degeneracies.lean

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,12 @@ theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ}
5353

5454
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
5555
X.σ i ≫ (P q).f (n + 1) = 0 := by
56-
revert i hi
57-
induction' q with q hq
58-
· intro i (hi : n + 1 ≤ i)
59-
omega
60-
· intro i (hi : n + 1 ≤ i + q + 1)
56+
induction q generalizing i with
57+
| zero => omega
58+
| succ q hq =>
6159
by_cases h : n + 1 ≤ (i : ℕ) + q
6260
· rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
63-
· replace hi : n = i + q := by
64-
obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
65-
rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
66-
nonpos_iff_eq_zero] at h
67-
rw [← add_left_inj 1, hj, left_eq_add, h]
61+
· replace hi : n = i + q := by omega
6862
rcases n with _ | n
6963
· fin_cases i
7064
dsimp at h hi

Mathlib/AlgebraicTopology/DoldKan/NCompGamma.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ variable {C : Type*} [Category C] [Preadditive C]
3636
theorem PInfty_comp_map_mono_eq_zero (X : SimplicialObject C) {n : ℕ} {Δ' : SimplexCategory}
3737
(i : Δ' ⟶ ⦋n⦌) [hi : Mono i] (h₁ : Δ'.len ≠ n) (h₂ : ¬Isδ₀ i) :
3838
PInfty.f n ≫ X.map i.op = 0 := by
39-
induction' Δ' using SimplexCategory.rec with m
39+
induction Δ' using SimplexCategory.rec with | _ m
4040
obtain ⟨k, hk⟩ := Nat.exists_eq_add_of_lt (len_lt_of_mono i fun h => by
4141
rw [← h] at h₁
4242
exact h₁ rfl)
@@ -78,8 +78,8 @@ theorem Γ₀_obj_termwise_mapMono_comp_PInfty (X : SimplicialObject C) {Δ Δ'
7878
(i : Δ ⟶ Δ') [Mono i] :
7979
Γ₀.Obj.Termwise.mapMono (AlternatingFaceMapComplex.obj X) i ≫ PInfty.f Δ.len =
8080
PInfty.f Δ'.len ≫ X.map i.op := by
81-
induction' Δ using SimplexCategory.rec with n
82-
induction' Δ' using SimplexCategory.rec with n'
81+
induction Δ using SimplexCategory.rec with | _ n
82+
induction Δ' using SimplexCategory.rec with | _ n'
8383
dsimp
8484
-- We start with the case `i` is an identity
8585
by_cases h : n = n'

Mathlib/AlgebraicTopology/DoldKan/Projections.lean

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ lemma P_succ (q : ℕ) : (P (q+1) : K[X] ⟶ K[X]) = P q ≫ (𝟙 _ + Hσ q) :=
5353
/-- All the `P q` coincide with `𝟙 _` in degree 0. -/
5454
@[simp]
5555
theorem P_f_0_eq (q : ℕ) : ((P q).f 0 : X _⦋0⦌ ⟶ X _⦋0⦌) = 𝟙 _ := by
56-
induction' q with q hq
57-
· rfl
58-
· simp only [P_succ, HomologicalComplex.add_f_apply, HomologicalComplex.comp_f,
56+
induction q with
57+
| zero => rfl
58+
| succ q hq =>
59+
simp only [P_succ, HomologicalComplex.add_f_apply, HomologicalComplex.comp_f,
5960
HomologicalComplex.id_f, id_comp, hq, Hσ_eq_zero, add_zero]
6061

6162
/-- `Q q` is the complement projection associated to `P q` -/
@@ -95,10 +96,12 @@ theorem of_P : ∀ q n : ℕ, HigherFacesVanish q ((P q).f (n + 1) : X _⦋n + 1
9596
@[reassoc]
9697
theorem comp_P_eq_self {Y : C} {n q : ℕ} {φ : Y ⟶ X _⦋n + 1⦌} (v : HigherFacesVanish q φ) :
9798
φ ≫ (P q).f (n + 1) = φ := by
98-
induction' q with q hq
99-
· simp only [P_zero]
99+
induction q with
100+
| zero =>
101+
simp only [P_zero]
100102
apply comp_id
101-
· simp only [P_succ, comp_add, HomologicalComplex.comp_f, HomologicalComplex.add_f_apply,
103+
| succ q hq =>
104+
simp only [P_succ, comp_add, HomologicalComplex.comp_f, HomologicalComplex.add_f_apply,
102105
comp_id, ← assoc, hq v.of_succ, add_eq_left]
103106
by_cases hqn : n < q
104107
· exact v.of_succ.comp_Hσ_eq_zero hqn
@@ -147,10 +150,12 @@ theorem Q_idem (q : ℕ) : (Q q : K[X] ⟶ K[X]) ≫ Q q = Q q := by
147150
def natTransP (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C where
148151
app _ := P q
149152
naturality _ _ f := by
150-
induction' q with q hq
151-
· dsimp [alternatingFaceMapComplex]
153+
induction q with
154+
| zero =>
155+
dsimp [alternatingFaceMapComplex]
152156
simp only [P_zero, id_comp, comp_id]
153-
· simp only [P_succ, add_comp, comp_add, assoc, comp_id, hq, reassoc_of% hq]
157+
| succ q hq =>
158+
simp only [P_succ, add_comp, comp_add, assoc, comp_id, hq, reassoc_of% hq]
154159
-- `erw` is needed to see through `natTransHσ q).app = Hσ q`
155160
erw [(natTransHσ q).naturality f]
156161
rfl
@@ -176,10 +181,12 @@ def natTransQ (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComp
176181
theorem map_P {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
177182
(X : SimplicialObject C) (q n : ℕ) :
178183
G.map ((P q : K[X] ⟶ _).f n) = (P q : K[((whiskering C D).obj G).obj X] ⟶ _).f n := by
179-
induction' q with q hq
180-
· simp only [P_zero]
184+
induction q with
185+
| zero =>
186+
simp only [P_zero]
181187
apply G.map_id
182-
· simp only [P_succ, comp_add, HomologicalComplex.comp_f, HomologicalComplex.add_f_apply,
188+
| succ q hq =>
189+
simp only [P_succ, comp_add, HomologicalComplex.comp_f, HomologicalComplex.add_f_apply,
183190
comp_id, Functor.map_add, Functor.map_comp, hq, map_Hσ]
184191

185192
theorem map_Q {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]

Mathlib/AlgebraicTopology/SimplexCategory/MorphismProperty.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ lemma Truncated.morphismProperty_eq_top
3333
W = ⊤ := by
3434
ext ⟨a, ha⟩ ⟨b, hb⟩ f
3535
simp only [MorphismProperty.top_apply, iff_true]
36-
induction' a using SimplexCategory.rec with a
37-
induction' b using SimplexCategory.rec with b
36+
induction a using SimplexCategory.rec with | _ a
37+
induction b using SimplexCategory.rec with | _ b
3838
dsimp at ha hb
3939
generalize h : a + b = c
4040
induction c generalizing a b with

Mathlib/AlgebraicTopology/SimplicialObject/Split.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ instance : Fintype (IndexSet Δ) :=
8585
A.e.toOrderHom⟩ :
8686
IndexSet Δ → Sigma fun k : Fin (Δ.unop.len + 1) => Fin (Δ.unop.len + 1) → Fin (k + 1))
8787
(by
88-
rintro ⟨Δ₁, α₁⟩ ⟨Δ₂, α₂⟩ h₁
89-
induction' Δ₁ using Opposite.rec with Δ₁
90-
induction' Δ₂ using Opposite.rec with Δ₂
88+
rintro ⟨⟨Δ₁⟩, α₁⟩ ⟨⟨Δ₂⟩, α₂⟩ h₁
9189
simp only [unop_op, Sigma.mk.inj_iff, Fin.mk.injEq] at h₁
9290
have h₂ : Δ₁ = Δ₂ := by
9391
ext1
@@ -246,11 +244,10 @@ theorem hom_ext' {Z : C} {Δ : SimplexCategoryᵒᵖ} (f g : X.obj Δ ⟶ Z)
246244
Cofan.IsColimit.hom_ext (s.isColimit Δ) _ _ h
247245

248246
theorem hom_ext (f g : X ⟶ Y) (h : ∀ n : ℕ, s.φ f n = s.φ g n) : f = g := by
249-
ext Δ
247+
ext ⟨Δ⟩
250248
apply s.hom_ext'
251249
intro A
252-
induction' Δ using Opposite.rec with Δ
253-
induction' Δ using SimplexCategory.rec with n
250+
induction Δ using SimplexCategory.rec with | _ n
254251
dsimp
255252
simp only [s.cofan_inj_comp_app, h]
256253

Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ lemma isIso_of_nonDegenerate (x : X.nonDegenerate n)
114114
(y : X.obj (op m)) (hy : X.map f.op y = x) :
115115
IsIso f := by
116116
obtain ⟨x, hx⟩ := x
117-
induction' m using SimplexCategory.rec with m
117+
induction m using SimplexCategory.rec with | _ m
118118
rw [mem_nonDegenerate_iff_notMem_degenerate] at hx
119119
by_contra!
120120
refine hx ⟨_, not_le.1 (fun h ↦ this ?_), f, y, hy⟩

Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ in a nerve can be recovered from the underlying ReflPrefunctor. -/
8484
def toNerve₂.mk.app (n : SimplexCategory.Truncated 2) :
8585
X.obj (op n) ⟶ (nerveFunctor₂.obj (Cat.of C)).obj (op n) := by
8686
obtain ⟨n, hn⟩ := n
87-
induction' n using SimplexCategory.rec with n
87+
induction n using SimplexCategory.rec with | _ n
8888
match n with
8989
| 0 => exact fun x => .mk₀ (F.obj x)
9090
| 1 => exact fun f => .mk₁ (F.map ⟨f, rfl, rfl⟩)
@@ -297,7 +297,7 @@ theorem toNerve₂.ext (F G : X ⟶ nerveFunctor₂.obj (Cat.of C))
297297
have eq₁ (x : X _⦋1⦌₂) : F.app (op ⦋1⦌₂) x = G.app (op ⦋1⦌₂) x :=
298298
congr((($hyp).map ⟨x, rfl, rfl⟩).1)
299299
ext ⟨⟨n, hn⟩⟩ x
300-
induction' n using SimplexCategory.rec with n
300+
induction n using SimplexCategory.rec with | _ n
301301
match n with
302302
| 0 => apply eq₀
303303
| 1 => apply eq₁

Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ lemma face_eq_ofSimplex {n : ℕ} (S : Finset (Fin (n + 1))) (m : ℕ) (e : Fin
210210
e.toOrderEmbedding.toOrderHom)) := by
211211
apply le_antisymm
212212
· rintro ⟨k⟩ x hx
213-
induction' k using SimplexCategory.rec with k
213+
induction k using SimplexCategory.rec with | _ k
214214
rw [mem_face_iff] at hx
215215
let φ : Fin (k + 1) →o S :=
216216
{ toFun i := ⟨x i, hx i⟩
@@ -240,7 +240,7 @@ def faceRepresentableBy {n : ℕ} (S : Finset (Fin (n + 1)))
240240
ext i : 3
241241
apply e.symm_apply_apply
242242
right_inv := fun ⟨x, hx⟩ ↦ by
243-
induction' j using SimplexCategory.rec with j
243+
induction j using SimplexCategory.rec with | _ j
244244
dsimp
245245
ext i : 2
246246
exact congr_arg Subtype.val

Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ lemma exists_pushouts
134134
lemma exists_larger_subobject {X : C} (A : Subobject X) (hA : A ≠ ⊤) :
135135
∃ (A' : Subobject X) (h : A < A'),
136136
(generatingMonomorphisms G).pushouts (Subobject.ofLE A A' h.le) := by
137-
induction' A using Subobject.ind with Y f _
137+
induction A using Subobject.ind with | _ f
138138
obtain ⟨X', i, p', hi, hi', hp', fac⟩ := exists_pushouts hG f
139139
(by simpa only [Subobject.isIso_iff_mk_eq_top] using hA)
140140
refine ⟨Subobject.mk p', Subobject.mk_lt_mk_of_comm i fac hi',

0 commit comments

Comments
 (0)