Skip to content

Commit eb097a9

Browse files
committed
feat(CategoryTheory/Groupoid): various induction principles for morphisms (#42527)
1 parent 4d476f6 commit eb097a9

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,24 @@ lemma morphismProperty_eq_top {W : MorphismProperty V.HomotopyCategory}
348348
rintro _ _ _ ⟨_, _, e⟩
349349
exact hW e)
350350

351+
/-- Induction principle for proving a property for all the morphisms
352+
in the homotopy category of a `2`-truncated simplicial set: it suffices
353+
to show that the property holds for morphisms induced by edges and that
354+
the property is stable under composition. -/
355+
@[elab_as_elim, cases_eliminator, induction_eliminator]
356+
lemma hom_rec {motive : ∀ {x y : V.HomotopyCategory}, (x ⟶ y) → Prop}
357+
(homMk : ∀ {x y : V _⦋0⦌₂} (e : Edge x y), motive (homMk e))
358+
(comp : ∀ {x y z : V.HomotopyCategory} (f : x ⟶ y) (g : y ⟶ z),
359+
motive f → motive g → motive (f ≫ g))
360+
{x y : V.HomotopyCategory} (f : x ⟶ y) : motive f := by
361+
let W : MorphismProperty V.HomotopyCategory := fun _ _ f ↦ motive f
362+
have : W.IsMultiplicative :=
363+
{ id_mem x := by
364+
obtain ⟨x, rfl⟩ := x.mk_surjective
365+
simpa using! homMk (.id x)
366+
comp_mem := comp }
367+
exact (morphismProperty_eq_top (W := W) homMk).symm.le f (by simp)
368+
351369
section
352370

353371
variable {D : Type*} [Category* D]

Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,32 @@ theorem of_eq :
139139
of V = (Quiver.Symmetrify.of ⋙q (Paths.of (Quiver.Symmetrify V))).comp
140140
(Quotient.functor <| @redStep V _).toPrefunctor := rfl
141141

142+
/-- Induction principle for proving a property for all the morphisms
143+
in the free groupoid of a quiver `V`: it suffices to prove the property
144+
for morphisms `(of V).map f` coming for the quiver `V` and their
145+
inverses, and that the property is multiplicative (i.e. stable under
146+
composition and satisfied by identities). -/
147+
@[elab_as_elim, cases_eliminator, induction_eliminator]
148+
lemma hom_rec {motive : ∀ {x y : Quiver.FreeGroupoid V}, (x ⟶ y) → Prop}
149+
(of_map : ∀ {x y : V} (f : x ⟶ y), motive ((of V).map f))
150+
(inv_of_map : ∀ {x y : V} (f : x ⟶ y), motive (inv ((of V).map f)))
151+
(id : ∀ (x : V), motive (𝟙 ((of V).obj x)))
152+
(comp : ∀ {x y z : Quiver.FreeGroupoid V} (f : x ⟶ y) (g : y ⟶ z),
153+
motive f → motive g → motive (f ≫ g))
154+
{x y : Quiver.FreeGroupoid V} (f : x ⟶ y) :
155+
motive f := by
156+
have {x y : Symmetrify V} (f : x ⟶ y) :
157+
motive ((Quotient.functor _).map ((Paths.of _).map f)) := by
158+
induction f with
159+
| inl f => apply of_map
160+
| inr f => simpa only [← Groupoid.inv_eq_inv] using! inv_of_map f
161+
induction x with | _ x
162+
induction y with | _ y
163+
obtain ⟨f, rfl⟩ := (Quotient.functor _).map_surjective f
164+
induction f using Paths.induction with
165+
| id => apply id
166+
| comp p f hp => simpa using! comp _ _ hp (this f)
167+
142168
section UniversalProperty
143169

144170
variable {V' : Type u'} [Groupoid V']

Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,27 @@ lemma of_obj_bijective : Function.Bijective (of C).obj where
9393
left _ _ h := by cases h; rfl
9494
right X := ⟨X.as.as, rfl⟩
9595

96+
/-- Induction principle for proving a property for all the morphisms
97+
in the free groupoid of a category `C`: it suffices to prove the property
98+
for morphisms coming from the category `C`, and that the property is
99+
stable under inverses and composition. -/
100+
@[elab_as_elim, cases_eliminator, induction_eliminator]
101+
lemma hom_rec {motive : ∀ ⦃x y : FreeGroupoid C⦄ (_ : x ⟶ y), Prop}
102+
(homMk : ∀ ⦃x y : C⦄ (f : x ⟶ y), motive (homMk f))
103+
(inv : ∀ ⦃x y : FreeGroupoid C⦄ (f : x ⟶ y), motive f → motive (inv f))
104+
(comp : ∀ ⦃x y z : FreeGroupoid C⦄ (f : x ⟶ y) (g : y ⟶ z),
105+
motive f → motive g → motive (f ≫ g))
106+
{x y : FreeGroupoid C} (f : x ⟶ y) :
107+
motive f := by
108+
induction x with | _ x
109+
induction y with | _ y
110+
obtain ⟨f, rfl⟩ := (Quotient.functor (FreeGroupoid.homRel C)).map_surjective f
111+
induction f with
112+
| of_map f => exact homMk f
113+
| inv_of_map f => simpa using! inv _ (homMk f)
114+
| id x => simpa using! homMk (𝟙 x)
115+
| comp _ _ hf hg => simpa using! comp _ _ hf hg
116+
96117
section UniversalProperty
97118

98119
variable {G : Type u₁} [Groupoid.{v₁} G]
@@ -132,6 +153,11 @@ theorem lift_unique (φ : C ⥤ G) (Φ : FreeGroupoid C ⥤ G) (hΦ : of C ⋙
132153
apply Quiver.FreeGroupoid.lift_unique
133154
exact congr_arg Functor.toPrefunctor hΦ
134155

156+
lemma lift_unique' {Φ Φ' : FreeGroupoid C ⥤ G} (h : of C ⋙ Φ = of C ⋙ Φ') : Φ = Φ' := by
157+
trans lift (of C ⋙ Φ')
158+
· exact lift_unique _ _ h
159+
· exact (lift_unique _ _ rfl).symm
160+
135161
theorem lift_id_comp_of : lift (𝟭 G) ⋙ of G = 𝟭 _ := by
136162
rw [lift_unique (of G) (lift (𝟭 G) ⋙ of G) (by rw [← Functor.assoc, lift_spec, Functor.id_comp])]
137163
symm; apply lift_unique

0 commit comments

Comments
 (0)