@@ -6,6 +6,7 @@ Authors: Amelia Livingston, Bryan Gin-ge Chen
66import Mathlib.Logic.Relation
77import Mathlib.Order.CompleteLattice.Basic
88import Mathlib.Order.GaloisConnection.Defs
9+ import Mathlib.Tactic.NthRewrite
910
1011/-!
1112# Equivalence relations
@@ -77,6 +78,7 @@ theorem ker_mk_eq (r : Setoid α) : ker (@Quotient.mk'' _ r) = r :=
7778theorem ker_apply_mk_out {f : α → β} (a : α) : f (⟦a⟧ : Quotient (Setoid.ker f)).out = f a :=
7879 @Quotient.mk_out _ (Setoid.ker f) a
7980
81+ @[simp]
8082theorem ker_def {f : α → β} {x y : α} : ker f x y ↔ f x = f y :=
8183 Iff.rfl
8284
@@ -314,14 +316,22 @@ theorem lift_unique {r : Setoid α} {f : α → β} (H : r ≤ ker f) (g : Quoti
314316 ext ⟨x⟩
315317 rw [← Quotient.mk, Quotient.lift_mk f H, Hg, Function.comp_apply, Quotient.mk''_eq_mk]
316318
319+ /-- Given a function `f`, lift it to the quotient by its kernel. -/
320+ abbrev kerLift (f : α → β) : Quotient (ker f) → β := Quotient.lift f fun _ _ ↦ id
321+
322+ @[simp]
323+ theorem kerLift_mk (f : α → β) (x : α) : kerLift f ⟦x⟧ = f x := rfl
324+
317325/-- Given a map f from α to β, the natural map from the quotient of α by the kernel of f is
318326injective. -/
319- theorem ker_lift_injective (f : α → β) : Injective (@Quotient.lift _ _ (ker f) f fun _ _ h => h) :=
327+ theorem injective_kerLift (f : α → β) : Injective <| kerLift f :=
320328 fun x y => Quotient.inductionOn₂' x y fun _ _ h => Quotient.sound' h
321329
330+ @ [deprecated (since := "2025-10-11" )] alias ker_lift_injective := injective_kerLift
331+
322332/-- Given a map f from α to β, the kernel of f is the unique equivalence relation on α whose
323333induced map from the quotient of α to β is injective. -/
324- theorem ker_eq_lift_of_injective {r : Setoid α} (f : α → β) (H : ∀ x y, r x y → f x = f y )
334+ theorem ker_eq_lift_of_injective {r : Setoid α} (f : α → β) (H : r ≤ ker f )
325335 (h : Injective (Quotient.lift f H)) : ker f = r :=
326336 le_antisymm
327337 (fun x y hk =>
@@ -330,23 +340,27 @@ theorem ker_eq_lift_of_injective {r : Setoid α} (f : α → β) (H : ∀ x y, r
330340
331341variable (r : Setoid α) (f : α → β)
332342
343+ /-- The image of `f` lifted to the quotient by its kernel is equal to the image of `f` itself. -/
344+ theorem range_kerLift_eq_range : Set.range (kerLift f) = Set.range f :=
345+ Set.range_quotient_lift (s := ker f) _
346+
347+ /-- The quotient of `α` by the kernel of a function `f`
348+ bijects with the image of `f` lifted to the quotient. -/
349+ noncomputable def quotientKerEquivRangeKerLift : Quotient (ker f) ≃ Set.range (kerLift f) :=
350+ .ofInjective _ <| injective_kerLift _
351+
333352/-- The first isomorphism theorem for sets: the quotient of α by the kernel of a function f
334353bijects with f's image. -/
335354noncomputable def quotientKerEquivRange : Quotient (ker f) ≃ Set.range f :=
336- Equiv.ofBijective
337- ((@Quotient.lift _ (Set.range f) (ker f) fun x => ⟨f x, Set.mem_range_self x⟩) fun _ _ h =>
338- Subtype.ext h)
339- ⟨fun x y h => ker_lift_injective f <| by rcases x with ⟨⟩; rcases y with ⟨⟩; injections,
340- fun ⟨_, z, hz⟩ =>
341- ⟨@Quotient.mk'' _ (ker f) z, Subtype.ext_iff.2 hz⟩⟩
355+ quotientKerEquivRangeKerLift _ |>.trans <| .setCongr <| range_kerLift_eq_range _
342356
343357/-- If `f` has a computable right-inverse, then the quotient by its kernel is equivalent to its
344358domain. -/
345359@[simps]
346360def quotientKerEquivOfRightInverse (g : β → α) (hf : Function.RightInverse g f) :
347361 Quotient (ker f) ≃ β where
348- toFun a := (Quotient.liftOn' a f) fun _ _ => id
349- invFun b := Quotient.mk'' (g b)
362+ toFun := kerLift f
363+ invFun := Quotient.mk'' ∘ g
350364 left_inv a := Quotient.inductionOn' a fun a => Quotient.sound' <| hf (f a)
351365 right_inv := hf
352366
0 commit comments