@@ -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+
96117section UniversalProperty
97118
98119variable {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+
135161theorem 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