Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit c711909

Browse files
committed
feat(linear_algebra/basic, group_theory/quotient_group, algebra/lie/quotient): ext lemmas for morphisms out of quotients (#8641)
This allows `ext` to see through quotients by subobjects of a type `A`, and apply ext lemmas specific to `A`.
1 parent 9e83de2 commit c711909

File tree

7 files changed

+71
-20
lines changed

7 files changed

+71
-20
lines changed

src/algebra/category/Group/colimits.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,9 @@ noncomputable def cokernel_iso_quotient {G H : AddCommGroup} (f : G ⟶ H) :
313313
ext1, simp only [coequalizer_as_cokernel, category.comp_id, cokernel.π_desc_assoc], ext1, refl,
314314
end,
315315
inv_hom_id' := begin
316-
ext1, induction x,
317-
{ simp only [colimit.ι_desc_apply, id_apply, lift_quot_mk,
318-
cofork.of_π_ι_app, comp_apply], refl },
319-
{ refl }
316+
ext x : 2,
317+
simp only [colimit.ι_desc_apply, id_apply, lift_mk, mk'_apply,
318+
cofork.of_π_ι_app, comp_apply, add_monoid_hom.comp_apply],
320319
end, }
321320

322321
end AddCommGroup

src/algebra/lie/basic.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ coe_injective $ funext h
461461
lemma ext_iff {f g : M →ₗ⁅R,L⁆ N} : f = g ↔ ∀ m, f m = g m :=
462462
by { rintro rfl m, refl, }, ext⟩
463463

464+
lemma congr_fun {f g : M →ₗ⁅R,L⁆ N} (h : f = g) (x : M) : f x = g x := h ▸ rfl
465+
464466
@[simp] lemma mk_coe (f : M →ₗ⁅R,L⁆ N) (h₁ h₂ h₃) :
465467
(⟨f, h₁, h₂, h₃⟩ : M →ₗ⁅R,L⁆ N) = f :=
466468
by { ext, refl, }

src/algebra/lie/quotient.lean

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ variables (N)
5959
/-- Given a Lie module `M` over a Lie algebra `L`, together with a Lie submodule `N ⊆ M`, there
6060
is a natural Lie algebra morphism from `L` to the linear endomorphism of the quotient `M/N`. -/
6161
def action_as_endo_map : L →ₗ⁅R⁆ module.End R N.quotient :=
62-
{ map_lie' := λ x y, by { ext n, apply quotient.induction_on' n, intros m,
63-
change mk ⁅⁅x, y⁆, m⁆ = mk (⁅x, ⁅y, m⁆⁆ - ⁅y, ⁅x, m⁆⁆),
64-
congr, apply lie_lie, },
62+
{ map_lie' := λ x y, by { ext m,
63+
change mk ⁅⁅x, y⁆, m⁆ = mk (⁅x, ⁅y, m⁆⁆ - ⁅y, ⁅x, m⁆⁆),
64+
congr, apply lie_lie, },
6565
..linear_map.comp (submodule.mapq_linear (N : submodule R M) ↑N) lie_submodule_invariant }
6666

6767
/-- Given a Lie module `M` over a Lie algebra `L`, together with a Lie submodule `N ⊆ M`, there is
@@ -127,6 +127,20 @@ instance lie_quotient_lie_algebra : lie_algebra R (quotient I) :=
127127
rw ←submodule.quotient.mk_smul, },
128128
apply congr_arg, apply lie_smul, } }
129129

130+
/-- `lie_submodule.quotient.mk` as a `lie_module_hom`. -/
131+
@[simps]
132+
def mk' : M →ₗ⁅R,L⁆ quotient N :=
133+
{ to_fun := mk, map_lie' := λ r m, rfl, ..N.to_submodule.mkq}
134+
135+
/-- Two `lie_module_hom`s from a quotient lie module are equal if their compositions with
136+
`lie_submodule.quotient.mk'` are equal.
137+
138+
See note [partially-applied ext lemmas]. -/
139+
@[ext]
140+
lemma lie_module_hom_ext ⦃f g : quotient N →ₗ⁅R,L⁆ M⦄ (h : f.comp (mk' N) = g.comp (mk' N)) :
141+
f = g :=
142+
lie_module_hom.ext $ λ x, quotient.induction_on' x $ lie_module_hom.congr_fun h
143+
130144
end quotient
131145

132146
end lie_submodule

src/algebra/ring_quot.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ The ring equivalence between `ring_quot r` and `(ideal.of_rel r).quotient`
261261
def ring_quot_equiv_ideal_quotient (r : B → B → Prop) :
262262
ring_quot r ≃+* (ideal.of_rel r).quotient :=
263263
ring_equiv.of_hom_inv (ring_quot_to_ideal_quotient r) (ideal_quotient_to_ring_quot r)
264-
(by { ext, simp, }) (by { ext ⟨x⟩, simp, })
264+
(by { ext, refl, }) (by { ext, refl, })
265265

266266
end comm_ring
267267

src/group_theory/quotient_group.lean

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ lemma coe_mk' : (mk' N : G → quotient N) = coe := rfl
8484
@[to_additive, simp]
8585
lemma mk'_apply (x : G) : mk' N x = x := rfl
8686

87+
/-- Two `monoid_hom`s from a quotient group are equal if their compositions with
88+
`quotient_group.mk'` are equal.
89+
90+
See note [partially-applied ext lemmas]. -/
91+
@[to_additive /-" Two `add_monoid_hom`s from an additive quotient group are equal if their
92+
compositions with `add_quotient_group.mk'` are equal.
93+
94+
See note [partially-applied ext lemmas]. "-/, ext]
95+
lemma monoid_hom_ext ⦃f g : quotient N →* H⦄ (h : f.comp (mk' N) = g.comp (mk' N)) : f = g :=
96+
monoid_hom.ext $ λ x, quotient_group.induction_on x $ (monoid_hom.congr_fun h : _)
97+
98+
attribute [ext] quotient_add_group.add_monoid_hom_ext
99+
87100
@[simp, to_additive quotient_add_group.eq_zero_iff]
88101
lemma eq_one_iff {N : subgroup G} [nN : N.normal] (x : G) : (x : quotient N) = 1 ↔ x ∈ N :=
89102
begin
@@ -285,8 +298,14 @@ def quotient_map_subgroup_of_of_le {A' A B' B : subgroup G}
285298
map _ _ (subgroup.inclusion h) $
286299
by simp [subgroup.subgroup_of, subgroup.comap_comap]; exact subgroup.comap_mono h'
287300

301+
@[simp, to_additive]
302+
lemma quotient_map_subgroup_of_of_le_coe {A' A B' B : subgroup G}
303+
[hAN : (A'.subgroup_of A).normal] [hBN : (B'.subgroup_of B).normal]
304+
(h' : A' ≤ B') (h : A ≤ B) (x : A) :
305+
quotient_map_subgroup_of_of_le h' h x = ↑(subgroup.inclusion h x : B) := rfl
306+
288307
/-- Let `A', A, B', B` be subgroups of `G`.
289-
If `A' = B'` and `A = B`, then the quotients `A / (A' ⊓ A)` and `B / (B' ⊓ B)` are isomorphic.
308+
If `A' = B'` and `A = B`, then the quotients `A / (A' ⊓ A)` and `B / (B' ⊓ B)` are isomorphic.
290309
291310
Applying this equiv is nicer than rewriting along the equalities, since the type of
292311
`(A'.subgroup_of A : subgroup A)` depends on on `A`.
@@ -301,9 +320,10 @@ def equiv_quotient_subgroup_of_of_eq {A' A B' B : subgroup G}
301320
[hAN : (A'.subgroup_of A).normal] [hBN : (B'.subgroup_of B).normal]
302321
(h' : A' = B') (h : A = B) :
303322
quotient (A'.subgroup_of A) ≃* quotient (B'.subgroup_of B) :=
304-
by apply monoid_hom.to_mul_equiv
305-
(quotient_map_subgroup_of_of_le h'.le h.le) (quotient_map_subgroup_of_of_le h'.ge h.ge);
306-
{ ext ⟨x⟩, simp [quotient_map_subgroup_of_of_le, map, lift, mk', subgroup.inclusion], refl }
323+
monoid_hom.to_mul_equiv
324+
(quotient_map_subgroup_of_of_le h'.le h.le) (quotient_map_subgroup_of_of_le h'.ge h.ge)
325+
(by { ext ⟨x, hx⟩, refl })
326+
(by { ext ⟨x, hx⟩, refl })
307327

308328
section snd_isomorphism_thm
309329

@@ -372,12 +392,11 @@ quotient_group.lift_mk' _ _ x
372392
"**Noether's third isomorphism theorem** for additive groups: `(A / N) / (M / N) ≃ A / M`."]
373393
def quotient_quotient_equiv_quotient :
374394
quotient_group.quotient (M.map (quotient_group.mk' N)) ≃* quotient_group.quotient M :=
375-
{ to_fun := quotient_quotient_equiv_quotient_aux N M h,
376-
inv_fun := quotient_group.map _ _ (quotient_group.mk' N) (subgroup.le_comap_map _ _),
377-
left_inv := λ x, quotient_group.induction_on' x $ λ x, quotient_group.induction_on' x $
378-
λ x, by simp,
379-
right_inv := λ x, quotient_group.induction_on' x $ λ x, by simp,
380-
map_mul' := monoid_hom.map_mul _ }
395+
monoid_hom.to_mul_equiv
396+
(quotient_quotient_equiv_quotient_aux N M h)
397+
(quotient_group.map _ _ (quotient_group.mk' N) (subgroup.le_comap_map _ _))
398+
(by { ext, simp })
399+
(by { ext, simp })
381400

382401
end third_iso_thm
383402

src/linear_algebra/basic.lean

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,14 @@ def mkq : M →ₗ[R] p.quotient :=
19211921

19221922
@[simp] theorem mkq_apply (x : M) : p.mkq x = quotient.mk x := rfl
19231923

1924+
/-- Two `linear_map`s from a quotient module are equal if their compositions with
1925+
`submodule.mkq` are equal.
1926+
1927+
See note [partially-applied ext lemmas]. -/
1928+
@[ext]
1929+
lemma linear_map_qext ⦃f g : p.quotient →ₗ[R] M₂⦄ (h : f.comp p.mkq = g.comp p.mkq) : f = g :=
1930+
linear_map.ext $ λ x, quotient.induction_on' x $ (linear_map.congr_fun h : _)
1931+
19241932
/-- The map from the quotient of `M` by a submodule `p` to `M₂` induced by a linear map `f : M → M₂`
19251933
vanishing on `p`, as a linear map. -/
19261934
def liftq (f : M →ₗ[R] M₂) (h : p ≤ f.ker) : p.quotient →ₗ[R] M₂ :=
@@ -2631,8 +2639,8 @@ def compatible_maps : submodule R (M →ₗ[R] M₂) :=
26312639
natural map $\{f ∈ Hom(M, M₂) | f(p) ⊆ q \} \to Hom(M/p, M₂/q)$ is linear. -/
26322640
def mapq_linear : compatible_maps p q →ₗ[R] p.quotient →ₗ[R] q.quotient :=
26332641
{ to_fun := λ f, mapq _ _ f.val f.property,
2634-
map_add' := λ x y, by { ext m', apply quotient.induction_on' m', intros m, refl, },
2635-
map_smul' := λ c f, by { ext m', apply quotient.induction_on' m', intros m, refl, } }
2642+
map_add' := λ x y, by { ext, refl, },
2643+
map_smul' := λ c f, by { ext, refl, } }
26362644

26372645
end submodule
26382646

src/ring_theory/ideal/basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,15 @@ instance (I : ideal α) : comm_ring I.quotient :=
475475
def mk (I : ideal α) : α →+* I.quotient :=
476476
⟨λ a, submodule.quotient.mk a, rfl, λ _ _, rfl, rfl, λ _ _, rfl⟩
477477

478+
/- Two `ring_homs`s from the quotient by an ideal are equal if their
479+
compositions with `ideal.quotient.mk'` are equal.
480+
481+
See note [partially-applied ext lemmas]. -/
482+
@[ext]
483+
lemma ring_hom_ext [non_assoc_semiring β] ⦃f g : I.quotient →+* β⦄
484+
(h : f.comp (mk I) = g.comp (mk I)) : f = g :=
485+
ring_hom.ext $ λ x, quotient.induction_on' x $ (ring_hom.congr_fun h : _)
486+
478487
instance : inhabited (quotient I) := ⟨mk I 37
479488

480489
protected theorem eq : mk I x = mk I y ↔ x - y ∈ I := submodule.quotient.eq I

0 commit comments

Comments
 (0)