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

Commit e5f9bec

Browse files
committed
chore(linear_algebra/basic): relax ring to semiring (#10030)
This relaxes a random selection of lemmas from `ring R` to `semiring R`, and cleans up some unused `variables` nearby. Probably the most useful of these are `submodule.mem_map_equiv`, `map_subtype.rel_iso`, and `submodule.disjoint_iff_comap_eq_bot`
1 parent 35cf154 commit e5f9bec

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

src/linear_algebra/basic.lean

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,7 @@ end
14051405
The decreasing sequence of submodules consisting of the ranges of the iterates of a linear map.
14061406
-/
14071407
@[simps]
1408-
def iterate_range {R M} [ring R] [add_comm_group M] [module R M] (f : M →ₗ[R] M) :
1409-
ℕ →ₘ order_dual (submodule R M) :=
1408+
def iterate_range (f : M →ₗ[R] M) : ℕ →ₘ order_dual (submodule R M) :=
14101409
⟨λ n, (f ^ n).range, λ n m w x h, begin
14111410
obtain ⟨c, rfl⟩ := le_iff_exists_add.mp w,
14121411
rw linear_map.mem_range at h,
@@ -1547,8 +1546,7 @@ end
15471546
The increasing sequence of submodules consisting of the kernels of the iterates of a linear map.
15481547
-/
15491548
@[simps]
1550-
def iterate_ker {R M} [ring R] [add_comm_group M] [module R M] (f : M →ₗ[R] M) :
1551-
ℕ →ₘ submodule R M :=
1549+
def iterate_ker (f : M →ₗ[R] M) : ℕ →ₘ submodule R M :=
15521550
⟨λ n, (f ^ n).ker, λ n m w x h, begin
15531551
obtain ⟨c, rfl⟩ := le_iff_exists_add.mp w,
15541552
rw linear_map.mem_ker at h,
@@ -1738,39 +1736,32 @@ by rw [of_le, ker_cod_restrict, ker_subtype]
17381736
lemma range_of_le (p q : submodule R M) (h : p ≤ q) : (of_le h).range = comap q.subtype p :=
17391737
by rw [← map_top, of_le, linear_map.map_cod_restrict, map_top, range_subtype]
17401738

1741-
end add_comm_monoid
1742-
1743-
section ring
1744-
1745-
variables [ring R] [ring R₂] [add_comm_group M] [add_comm_group M₂] [module R M] [module R₂ M₂]
1746-
variables (p p' : submodule R M) (q : submodule R₂ M₂)
1747-
variables {τ₁₂ : R →+* R₂}
1748-
1749-
open linear_map
1750-
17511739
lemma disjoint_iff_comap_eq_bot {p q : submodule R M} :
17521740
disjoint p q ↔ comap p.subtype q = ⊥ :=
1753-
by rw [eq_bot_iff, ← map_le_map_iff' p.ker_subtype, map_bot, map_comap_subtype, disjoint]
1741+
by rw [←(map_injective_of_injective (show injective p.subtype, from subtype.coe_injective)).eq_iff,
1742+
map_comap_subtype, map_bot, disjoint_iff]
17541743

17551744
/-- If `N ⊆ M` then submodules of `N` are the same as submodules of `M` contained in `N` -/
1756-
def map_subtype.rel_iso :
1757-
submodule R p ≃o {p' : submodule R M // p' ≤ p} :=
1745+
def map_subtype.rel_iso : submodule R p ≃o {p' : submodule R M // p' ≤ p} :=
17581746
{ to_fun := λ p', ⟨map p.subtype p', map_subtype_le p _⟩,
17591747
inv_fun := λ q, comap p.subtype q,
1760-
left_inv := λ p', comap_map_eq_self $ by simp,
1748+
left_inv := λ p', comap_map_eq_of_injective subtype.coe_injective p',
17611749
right_inv := λ ⟨q, hq⟩, subtype.ext_val $ by simp [map_comap_subtype p, inf_of_le_right hq],
1762-
map_rel_iff' := λ p₁ p₂, map_le_map_iff' (ker_subtype p) }
1750+
map_rel_iff' := λ p₁ p₂, subtype.coe_le_coe.symm.trans begin
1751+
dsimp,
1752+
rw [map_le_iff_le_comap,
1753+
comap_map_eq_of_injective (show injective p.subtype, from subtype.coe_injective) p₂],
1754+
end }
17631755

17641756
/-- If `p ⊆ M` is a submodule, the ordering of submodules of `p` is embedded in the ordering of
17651757
submodules of `M`. -/
1766-
def map_subtype.order_embedding :
1767-
submodule R p ↪o submodule R M :=
1758+
def map_subtype.order_embedding : submodule R p ↪o submodule R M :=
17681759
(rel_iso.to_rel_embedding $ map_subtype.rel_iso p).trans (subtype.rel_embedding _ _)
17691760

17701761
@[simp] lemma map_subtype_embedding_eq (p' : submodule R p) :
17711762
map_subtype.order_embedding p p' = map p.subtype p' := rfl
17721763

1773-
end ring
1764+
end add_comm_monoid
17741765

17751766
end submodule
17761767

@@ -2387,9 +2378,9 @@ end submodule
23872378

23882379
namespace submodule
23892380

2390-
variables [comm_ring R] [comm_ring R₂]
2391-
variables [add_comm_group M] [add_comm_group M₂] [module R M] [module R₂ M₂]
2392-
variables [add_comm_group N] [add_comm_group N₂] [module R N] [module R N₂]
2381+
variables [comm_semiring R] [comm_semiring R₂]
2382+
variables [add_comm_monoid M] [add_comm_monoid M₂] [module R M] [module R₂ M₂]
2383+
variables [add_comm_monoid N] [add_comm_monoid N₂] [module R N] [module R N₂]
23932384
variables {τ₁₂ : R →+* R₂} {τ₂₁ : R₂ →+* R}
23942385
variables [ring_hom_inv_pair τ₁₂ τ₂₁] [ring_hom_inv_pair τ₂₁ τ₁₂]
23952386
variables (p : submodule R M) (q : submodule R₂ M₂)

0 commit comments

Comments
 (0)