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

Commit ba5d1f6

Browse files
committed
feat(linear_algebra/basic): add comap span lemmas (#5744)
We already had `map_span` but nothing for `comap`.
1 parent bd57804 commit ba5d1f6

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

src/linear_algebra/basic.lean

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,11 @@ lemma map_span (f : M →ₗ[R] M₂) (s : set M) :
787787
eq.symm $ span_eq_of_le _ (set.image_subset f subset_span) $
788788
map_le_iff_le_comap.2 $ span_le.2 $ λ x hx, subset_span ⟨x, hx, rfl⟩
789789

790+
/- See also `span_preimage_eq` below. -/
791+
lemma span_preimage_le (f : M →ₗ[R] M₂) (s : set M₂) :
792+
span R (f ⁻¹' s) ≤ (span R s).comap f :=
793+
by { rw [span_le, comap_coe], exact preimage_mono (subset_span), }
794+
790795
/-- An induction principle for span membership. If `p` holds for 0 and all elements of `s`, and is
791796
preserved under addition and scalar multiplication, then `p` holds for all elements of the span of
792797
`s`. -/
@@ -1478,29 +1483,43 @@ section ring
14781483

14791484
variables [ring R] [add_comm_group M] [add_comm_group M₂] [add_comm_group M₃]
14801485
variables [semimodule R M] [semimodule R M₂] [semimodule R M₃]
1486+
variables {f : M →ₗ[R] M₂}
14811487
include R
14821488
open submodule
14831489

1484-
theorem sub_mem_ker_iff {f : M →ₗ[R] M₂} {x y} : x - y ∈ f.ker ↔ f x = f y :=
1490+
theorem sub_mem_ker_iff {x y} : x - y ∈ f.ker ↔ f x = f y :=
14851491
by rw [mem_ker, map_sub, sub_eq_zero]
14861492

1487-
theorem disjoint_ker' {f : M →ₗ[R] M₂} {p : submodule R M} :
1493+
theorem disjoint_ker' {p : submodule R M} :
14881494
disjoint p (ker f) ↔ ∀ x y ∈ p, f x = f y → x = y :=
14891495
disjoint_ker.trans
14901496
⟨λ H x y hx hy h, eq_of_sub_eq_zero $ H _ (sub_mem _ hx hy) (by simp [h]),
14911497
λ H x h₁ h₂, H x 0 h₁ (zero_mem _) (by simpa using h₂)⟩
14921498

1493-
theorem inj_of_disjoint_ker {f : M →ₗ[R] M₂} {p : submodule R M}
1499+
theorem inj_of_disjoint_ker {p : submodule R M}
14941500
{s : set M} (h : s ⊆ p) (hd : disjoint p (ker f)) :
14951501
∀ x y ∈ s, f x = f y → x = y :=
14961502
λ x y hx hy, disjoint_ker'.1 hd _ _ (h hx) (h hy)
14971503

1498-
theorem ker_eq_bot {f : M →ₗ[R] M₂} : ker f = ⊥ ↔ injective f :=
1504+
theorem ker_eq_bot : ker f = ⊥ ↔ injective f :=
14991505
by simpa [disjoint] using @disjoint_ker' _ _ _ _ _ _ _ _ f ⊤
15001506

1507+
lemma ker_le_iff {p : submodule R M} : ker f ≤ p ↔ ∃ (y ∈ range f), f ⁻¹' {y} ⊆ p :=
1508+
begin
1509+
split,
1510+
{ intros h, use 0, rw [← mem_coe, f.range_coe], exact ⟨⟨0, map_zero f⟩, h⟩, },
1511+
{ rintros ⟨y, h₁, h₂⟩,
1512+
rw le_def, intros z hz, simp only [mem_ker, mem_coe] at hz,
1513+
rw [← mem_coe, f.range_coe, set.mem_range] at h₁, obtain ⟨x, hx⟩ := h₁,
1514+
have hx' : x ∈ p, { exact h₂ hx, },
1515+
have hxz : z + x ∈ p, { apply h₂, simp [hx, hz], },
1516+
suffices : z + x - x ∈ p, { simpa only [this, add_sub_cancel], },
1517+
exact p.sub_mem hxz hx', },
1518+
end
1519+
15011520
/-- If the union of the kernels `ker f` and `ker g` spans the domain, then the range of
15021521
`prod f g` is equal to the product of `range f` and `range g`. -/
1503-
lemma range_prod_eq {f : M →ₗ[R] M₂} {g : M →ₗ[R] M₃} (h : ker f ⊔ ker g = ⊤) :
1522+
lemma range_prod_eq {g : M →ₗ[R] M₃} (h : ker f ⊔ ker g = ⊤) :
15041523
range (prod f g) = (range f).prod (range g) :=
15051524
begin
15061525
refine le_antisymm (f.range_prod_le g) _,
@@ -1764,6 +1783,20 @@ def comap_mkq.order_embedding :
17641783
@[simp] lemma comap_mkq_embedding_eq (p' : submodule R p.quotient) :
17651784
comap_mkq.order_embedding p p' = comap p.mkq p' := rfl
17661785

1786+
lemma span_preimage_eq {f : M →ₗ[R] M₂} {s : set M₂} (h₀ : s.nonempty) (h₁ : s ⊆ range f) :
1787+
span R (f ⁻¹' s) = (span R s).comap f :=
1788+
begin
1789+
suffices : (span R s).comap f ≤ span R (f ⁻¹' s),
1790+
{ exact le_antisymm (span_preimage_le f s) this, },
1791+
have hk : ker f ≤ span R (f ⁻¹' s),
1792+
{ let y := classical.some h₀, have hy : y ∈ s, { exact classical.some_spec h₀, },
1793+
rw ker_le_iff, use [y, h₁ hy], rw ← set.singleton_subset_iff at hy,
1794+
exact set.subset.trans subset_span (span_mono (set.preimage_mono hy)), },
1795+
rw ← left_eq_sup at hk, rw f.range_coe at h₁,
1796+
rw [hk, ← map_le_map_iff, map_span, map_comap_eq, set.image_preimage_eq_of_subset h₁],
1797+
exact inf_le_right,
1798+
end
1799+
17671800
end ring
17681801

17691802
end submodule

0 commit comments

Comments
 (0)