Skip to content

Commit debc3b0

Browse files
ADedeckermichaellee94
authored andcommitted
chore: cleanup API around LinearMap.surjective_domRestrict_iff (leanprover-community#41235)
- semilinearize [LinearMap.range_domRestrict](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Module/Submodule/Range.html#LinearMap.range_domRestrict) - add `map_eq_range_iff` as a replacement for [LinearMap.range_domRestrict_eq_range_iff](https://leanprover-community.github.io/mathlib4_docs/Mathlib/LinearAlgebra/Span/Basic.html#LinearMap.range_domRestrict_eq_range_iff), with a golfed proof. - use `Codisjoint` in [LinearMap.surjective_domRestrict_iff](https://leanprover-community.github.io/mathlib4_docs/Mathlib/LinearAlgebra/Span/Basic.html#LinearMap.surjective_domRestrict_iff)
1 parent fdee760 commit debc3b0

3 files changed

Lines changed: 15 additions & 19 deletions

File tree

Mathlib/Algebra/Module/Submodule/Range.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ theorem range_neg {R : Type*} {R₂ : Type*} {M : Type*} {M₂ : Type*} [Semirin
114114
change range ((-LinearMap.id : M₂ →ₗ[R₂] M₂).comp f) = _
115115
rw [range_comp, Submodule.map_neg, Submodule.map_id]
116116

117-
@[simp] lemma range_domRestrict [Module R M₂] (K : Submodule R M) (f : M →ₗ[R] M₂) :
117+
@[simp] lemma range_domRestrict [RingHomSurjective τ₁₂] (K : Submodule R M) (f : M →ₛₗ[τ₁₂] M₂) :
118118
range (domRestrict f K) = K.map f := by ext; simp
119119

120120
lemma range_domRestrict_le_range [RingHomSurjective τ₁₂] (f : M →ₛₗ[τ₁₂] M₂) (S : Submodule R M) :
@@ -303,6 +303,7 @@ open LinearMap
303303
@[simp]
304304
theorem map_top [RingHomSurjective τ₁₂] (f : M →ₛₗ[τ₁₂] M₂) : map f ⊤ = range f :=
305305
(range_eq_map f).symm
306+
306307
@[simp]
307308
theorem range_subtype : range p.subtype = p := by simpa using map_comap_subtype p ⊤
308309

Mathlib/LinearAlgebra/Span/Basic.lean

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ end AddCommGroup
529529

530530
section AddCommGroup
531531

532+
-- TODO: Multiple lemmas in this section should be in earlier files
533+
532534
variable [Semiring R] [Semiring R₂]
533535
variable [AddCommGroup M] [Module R M] [AddCommGroup M₂] [Module R₂ M₂]
534536
variable {τ₁₂ : R →+* R₂} [RingHomSurjective τ₁₂]
@@ -539,6 +541,11 @@ theorem comap_map_eq (f : M →ₛₗ[τ₁₂] M₂) (p : Submodule R M) :
539541
rintro x ⟨y, hy, e⟩
540542
exact mem_sup.2 ⟨y, hy, x - y, by simpa using sub_eq_zero.2 e.symm, by simp⟩
541543

544+
theorem map_eq_range_iff {f : M →ₛₗ[τ₁₂] M₂} {p : Submodule R M} :
545+
map f p = f.range ↔ Codisjoint p f.ker := by
546+
simp_rw [le_antisymm_iff, LinearMap.map_le_range, true_and, ← map_top, map_le_iff_le_comap,
547+
comap_map_eq, codisjoint_iff_le_sup]
548+
542549
theorem map_lt_map_of_le_of_sup_lt_sup {p p' : Submodule R M} {f : M →ₛₗ[τ₁₂] M₂} (hab : p ≤ p')
543550
(h : p ⊔ LinearMap.ker f < p' ⊔ LinearMap.ker f) : Submodule.map f p < Submodule.map f p' := by
544551
simp_rw [← comap_map_eq] at h
@@ -587,28 +594,16 @@ lemma comap_covBy_of_surjective {f : M →ₛₗ[τ₁₂] M₂} (hf : Surjectiv
587594
rwa [← comap_lt_comap_iff_of_surjective hf, comap_map_eq, sup_eq_left.mpr]
588595
refine (LinearMap.ker_le_comap (f : M →ₛₗ[τ₁₂] M₂)).trans h₁.le
589596

597+
@[deprecated map_eq_range_iff (since := "2026-07-01")]
590598
lemma _root_.LinearMap.range_domRestrict_eq_range_iff {f : M →ₛₗ[τ₁₂] M₂} {S : Submodule R M} :
591-
LinearMap.range (f.domRestrict S) = LinearMap.range f ↔ S ⊔ (LinearMap.ker f) = ⊤ := by
592-
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
593-
· rw [eq_top_iff]
594-
intro x _
595-
have : f x ∈ LinearMap.range f := LinearMap.mem_range_self f x
596-
rw [← h] at this
597-
obtain ⟨y, hy⟩ : ∃ y : S, f.domRestrict S y = f x := this
598-
have : (y : M) + (x - y) ∈ S ⊔ (LinearMap.ker f) := Submodule.add_mem_sup y.2 (by simp [← hy])
599-
simpa using this
600-
· refine le_antisymm (LinearMap.range_domRestrict_le_range f S) ?_
601-
rintro x ⟨y, rfl⟩
602-
obtain ⟨s, hs, t, ht, rfl⟩ : ∃ s, s ∈ S ∧ ∃ t, t ∈ LinearMap.ker f ∧ s + t = y :=
603-
Submodule.mem_sup.1 (by simp [h])
604-
exact ⟨⟨s, hs⟩, by simp [LinearMap.mem_ker.1 ht]⟩
599+
LinearMap.range (f.domRestrict S) = LinearMap.range f ↔ Codisjoint S f.ker := by
600+
simp [map_eq_range_iff]
605601

606602
@[simp] lemma _root_.LinearMap.surjective_domRestrict_iff
607603
{f : M →ₛₗ[τ₁₂] M₂} {S : Submodule R M} (hf : Surjective f) :
608-
Surjective (f.domRestrict S) ↔ S ⊔ LinearMap.ker f = ⊤ := by
604+
Surjective (f.domRestrict S) ↔ Codisjoint S f.ker := by
609605
rw [← LinearMap.range_eq_top] at hf ⊢
610-
rw [← hf]
611-
exact LinearMap.range_domRestrict_eq_range_iff
606+
rw [← hf, LinearMap.range_domRestrict, map_eq_range_iff]
612607

613608
lemma biSup_comap_eq_top_of_surjective {ι : Type*} (s : Set ι) (hs : s.Nonempty)
614609
(p : ι → Submodule R₂ M₂) (hp : ⨆ i ∈ s, p i = ⊤)

Mathlib/MeasureTheory/Measure/Haar/Disintegration.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ theorem LinearMap.exists_map_addHaar_eq_smul_addHaar' (h : Function.Surjective L
6464
have P_cont : Continuous P := LinearMap.continuous_of_finiteDimensional _
6565
have I : Function.Bijective (LinearMap.domRestrict L T) :=
6666
⟨LinearMap.injective_domRestrict_iff.2 (IsCompl.inf_eq_bot hT.symm),
67-
(LinearMap.surjective_domRestrict_iff h).2 hT.symm.sup_eq_top
67+
(LinearMap.surjective_domRestrict_iff h).2 hT.symm.codisjoint
6868
let L' : T ≃ₗ[𝕜] F := LinearEquiv.ofBijective (LinearMap.domRestrict L T) I
6969
have L'_cont : Continuous L' := LinearMap.continuous_of_finiteDimensional _
7070
have A : L = (L' : T →ₗ[𝕜] F).comp (P.comp (M.symm : E →ₗ[𝕜] (S × T))) := by

0 commit comments

Comments
 (0)