Skip to content

Commit

Permalink
chore(linear_algebra/basic): relax ring to semiring (#10030)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
eric-wieser committed Oct 31, 2021
1 parent 35cf154 commit e5f9bec
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions src/linear_algebra/basic.lean
Expand Up @@ -1405,8 +1405,7 @@ end
The decreasing sequence of submodules consisting of the ranges of the iterates of a linear map.
-/
@[simps]
def iterate_range {R M} [ring R] [add_comm_group M] [module R M] (f : M →ₗ[R] M) :
ℕ →ₘ order_dual (submodule R M) :=
def iterate_range (f : M →ₗ[R] M) : ℕ →ₘ order_dual (submodule R M) :=
⟨λ n, (f ^ n).range, λ n m w x h, begin
obtain ⟨c, rfl⟩ := le_iff_exists_add.mp w,
rw linear_map.mem_range at h,
Expand Down Expand Up @@ -1547,8 +1546,7 @@ end
The increasing sequence of submodules consisting of the kernels of the iterates of a linear map.
-/
@[simps]
def iterate_ker {R M} [ring R] [add_comm_group M] [module R M] (f : M →ₗ[R] M) :
ℕ →ₘ submodule R M :=
def iterate_ker (f : M →ₗ[R] M) : ℕ →ₘ submodule R M :=
⟨λ n, (f ^ n).ker, λ n m w x h, begin
obtain ⟨c, rfl⟩ := le_iff_exists_add.mp w,
rw linear_map.mem_ker at h,
Expand Down Expand Up @@ -1738,39 +1736,32 @@ by rw [of_le, ker_cod_restrict, ker_subtype]
lemma range_of_le (p q : submodule R M) (h : p ≤ q) : (of_le h).range = comap q.subtype p :=
by rw [← map_top, of_le, linear_map.map_cod_restrict, map_top, range_subtype]

end add_comm_monoid

section ring

variables [ring R] [ring R₂] [add_comm_group M] [add_comm_group M₂] [module R M] [module R₂ M₂]
variables (p p' : submodule R M) (q : submodule R₂ M₂)
variables {τ₁₂ : R →+* R₂}

open linear_map

lemma disjoint_iff_comap_eq_bot {p q : submodule R M} :
disjoint p q ↔ comap p.subtype q = ⊥ :=
by rw [eq_bot_iff, ← map_le_map_iff' p.ker_subtype, map_bot, map_comap_subtype, disjoint]
by rw [←(map_injective_of_injective (show injective p.subtype, from subtype.coe_injective)).eq_iff,
map_comap_subtype, map_bot, disjoint_iff]

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

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

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

end ring
end add_comm_monoid

end submodule

Expand Down Expand Up @@ -2387,9 +2378,9 @@ end submodule

namespace submodule

variables [comm_ring R] [comm_ring R₂]
variables [add_comm_group M] [add_comm_group M₂] [module R M] [module R₂ M₂]
variables [add_comm_group N] [add_comm_group N₂] [module R N] [module R N₂]
variables [comm_semiring R] [comm_semiring R₂]
variables [add_comm_monoid M] [add_comm_monoid M₂] [module R M] [module R₂ M₂]
variables [add_comm_monoid N] [add_comm_monoid N₂] [module R N] [module R N₂]
variables {τ₁₂ : R →+* R₂} {τ₂₁ : R₂ →+* R}
variables [ring_hom_inv_pair τ₁₂ τ₂₁] [ring_hom_inv_pair τ₂₁ τ₁₂]
variables (p : submodule R M) (q : submodule R₂ M₂)
Expand Down

0 comments on commit e5f9bec

Please sign in to comment.