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

Commit d5330fe

Browse files
committed
chore(algebra/category): remove duplicated proofs (#7349)
The results added in #7100 already exist. I moved them to the place where Scott added the duplicates. Hopefully that will make them more discoverable.
1 parent 6b2bb8a commit d5330fe

File tree

4 files changed

+29
-54
lines changed

4 files changed

+29
-54
lines changed

src/algebra/category/Module/basic.lean

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -229,29 +229,6 @@ instance : preadditive (Module.{v} R) :=
229229

230230
end preadditive
231231

232-
section epi_mono
233-
variables {M N : Module.{v} R} (f : M ⟶ N)
234-
235-
lemma ker_eq_bot_of_mono [mono f] : f.ker = ⊥ :=
236-
linear_map.ker_eq_bot_of_cancel $ λ u v, (@cancel_mono _ _ _ _ _ f _ ↟u ↟v).1
237-
238-
lemma range_eq_top_of_epi [epi f] : f.range = ⊤ :=
239-
linear_map.range_eq_top_of_cancel $ λ u v, (@cancel_epi _ _ _ _ _ f _ ↟u ↟v).1
240-
241-
lemma mono_of_ker_eq_bot (hf : f.ker = ⊥) : mono f :=
242-
concrete_category.mono_of_injective _ $ linear_map.ker_eq_bot.1 hf
243-
244-
lemma epi_of_range_eq_top (hf : f.range = ⊤) : epi f :=
245-
concrete_category.epi_of_surjective _ $ linear_map.range_eq_top.1 hf
246-
247-
instance mono_as_hom'_subtype (U : submodule R M) : mono ↾U.subtype :=
248-
mono_of_ker_eq_bot _ (submodule.ker_subtype U)
249-
250-
instance epi_as_hom''_mkq (U : submodule R M) : epi ↿U.mkq :=
251-
epi_of_range_eq_top _ $ submodule.range_mkq _
252-
253-
end epi_mono
254-
255232
end Module
256233

257234
instance (M : Type u) [add_comm_group M] [module R M] : has_coe (submodule R M) (Module R) :=

src/algebra/category/Module/epi_mono.lean

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,36 @@ universes v u
1717

1818
open category_theory
1919
open Module
20+
open_locale Module
2021

2122
namespace Module
2223

23-
variables {R : Type u} [ring R]
24+
variables {R : Type u} [ring R] {X Y : Module.{v} R} (f : X ⟶ Y)
2425

25-
/--
26-
We could also give a direct proof via `linear_map.ker_eq_bot_of_cancel`.
27-
(This would allow generalising from `Module.{u}` to `Module.{v}`.)
28-
-/
29-
lemma mono_iff_injective {X Y : Module.{u} R} (f : X ⟶ Y) : mono f ↔ function.injective f :=
30-
begin
31-
rw ←category_theory.mono_iff_injective,
32-
exact ⟨right_adjoint_preserves_mono (adj R), faithful_reflects_mono (forget (Module.{u} R))⟩,
33-
end
34-
35-
lemma epi_iff_surjective {X Y : Module.{v} R} (f : X ⟶ Y) : epi f ↔ function.surjective f :=
36-
begin
37-
fsplit,
38-
{ intro h,
39-
rw ←linear_map.range_eq_top,
40-
apply linear_map.range_eq_top_of_cancel,
41-
-- Now we have to fight a bit with the difference between `Y` and `↥Y`.
42-
intros u v w,
43-
change Y ⟶ Module.of R (linear_map.range f).quotient at u,
44-
change Y ⟶ Module.of R (linear_map.range f).quotient at v,
45-
apply (cancel_epi (Module.of_self_iso Y).hom).mp,
46-
apply h.left_cancellation,
47-
cases X, cases Y, -- after this we can see `Module.of_self_iso` is just the identity.
48-
convert w; { dsimp, erw category.id_comp, }, },
49-
{ rw ←category_theory.epi_iff_surjective,
50-
exact faithful_reflects_epi (forget (Module.{v} R)), },
51-
end
26+
lemma ker_eq_bot_of_mono [mono f] : f.ker = ⊥ :=
27+
linear_map.ker_eq_bot_of_cancel $ λ u v, (@cancel_mono _ _ _ _ _ f _ ↟u ↟v).1
28+
29+
lemma range_eq_top_of_epi [epi f] : f.range = ⊤ :=
30+
linear_map.range_eq_top_of_cancel $ λ u v, (@cancel_epi _ _ _ _ _ f _ ↟u ↟v).1
31+
32+
lemma mono_iff_ker_eq_bot : mono f ↔ f.ker = ⊥ :=
33+
⟨λ hf, by exactI ker_eq_bot_of_mono _,
34+
λ hf, concrete_category.mono_of_injective _ $ linear_map.ker_eq_bot.1 hf⟩
35+
36+
lemma mono_iff_injective : mono f ↔ function.injective f :=
37+
by rw [mono_iff_ker_eq_bot, linear_map.ker_eq_bot]
38+
39+
lemma epi_iff_range_eq_top : epi f ↔ f.range = ⊤ :=
40+
⟨λ hf, by exactI range_eq_top_of_epi _,
41+
λ hf, concrete_category.epi_of_surjective _ $ linear_map.range_eq_top.1 hf⟩
42+
43+
lemma epi_iff_surjective : epi f ↔ function.surjective f :=
44+
by rw [epi_iff_range_eq_top, linear_map.range_eq_top]
45+
46+
instance mono_as_hom'_subtype (U : submodule R X) : mono ↾U.subtype :=
47+
(mono_iff_ker_eq_bot _).mpr (submodule.ker_subtype U)
5248

49+
instance epi_as_hom''_mkq (U : submodule R X) : epi ↿U.mkq :=
50+
(epi_iff_range_eq_top _).mpr $ submodule.range_mkq _
5351

5452
end Module

src/algebra/category/Module/kernels.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Markus Himmel. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Markus Himmel
55
-/
6-
import algebra.category.Module.basic
6+
import algebra.category.Module.epi_mono
77

88
/-!
99
# The concrete (co)kernels in the category of modules are (co)kernels in the categorical sense.
@@ -48,7 +48,7 @@ cofork.is_colimit.mk _
4848
(λ s, f.range.liftq_mkq (cofork.π s) _)
4949
(λ s m h,
5050
begin
51-
haveI : epi (as_hom f.range.mkq) := epi_of_range_eq_top _ (submodule.range_mkq _),
51+
haveI : epi (as_hom f.range.mkq) := (epi_iff_range_eq_top _).mpr (submodule.range_mkq _),
5252
apply (cancel_epi (as_hom f.range.mkq)).1,
5353
convert h walking_parallel_pair.one,
5454
exact submodule.liftq_mkq _ _ _

src/algebra/category/Module/subobject.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2021 Markus Himmel. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Markus Himmel
55
-/
6-
import algebra.category.Module.basic
6+
import algebra.category.Module.epi_mono
77
import category_theory.subobject.well_powered
88

99
/-!

0 commit comments

Comments
 (0)