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

Commit b091c3f

Browse files
committed
feat(algebra/direct_sum): the submodules of an internal direct sum satisfy supr A = ⊤ (#8274)
The main results here are: * `direct_sum.add_submonoid_is_internal.supr_eq_top` * `direct_sum.submodule_is_internal.supr_eq_top` Which we prove using the new lemmas * `add_submonoid.supr_eq_mrange_dfinsupp_sum_add_hom` * `submodule.supr_eq_range_dfinsupp_lsum` There's no obvious way to reuse the proofs between the two, but thankfully all four proofs are quite short anyway. These should aid in shortening #8246.
1 parent 3a0ef3c commit b091c3f

File tree

4 files changed

+79
-2
lines changed

4 files changed

+79
-2
lines changed

src/algebra/direct_sum.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ def add_submonoid_is_internal {M : Type*} [decidable_eq ι] [add_comm_monoid M]
178178
(A : ι → add_submonoid M) : Prop :=
179179
function.bijective (direct_sum.to_add_monoid (λ i, (A i).subtype) : (⨁ i, A i) →+ M)
180180

181+
lemma add_submonoid_is_internal.supr_eq_top {M : Type*} [decidable_eq ι] [add_comm_monoid M]
182+
(A : ι → add_submonoid M)
183+
(h : add_submonoid_is_internal A) : supr A = ⊤ :=
184+
begin
185+
rw [add_submonoid.supr_eq_mrange_dfinsupp_sum_add_hom, add_monoid_hom.mrange_top_iff_surjective],
186+
exact function.bijective.surjective h,
187+
end
188+
181189
/-- The `direct_sum` formed by a collection of `add_subgroup`s of `M` is said to be internal if the
182190
canonical map `(⨁ i, A i) →+ M` is bijective.
183191

src/data/dfinsupp.lean

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,35 @@ begin
958958
exact h
959959
end
960960

961+
/-- The supremum of a family of commutative additive submonoids is equal to the range of
962+
`finsupp.sum_add_hom`; that is, every element in the `supr` can be produced from taking a finite
963+
number of non-zero elements of `p i`, coercing them to `γ`, and summing them. -/
964+
lemma _root_.add_submonoid.supr_eq_mrange_dfinsupp_sum_add_hom [add_comm_monoid γ]
965+
(p : ι → add_submonoid γ) : supr p = (dfinsupp.sum_add_hom (λ i, (p i).subtype)).mrange :=
966+
begin
967+
apply le_antisymm,
968+
{ apply supr_le _,
969+
intros i y hy,
970+
exact ⟨dfinsupp.single i ⟨y, hy⟩, dfinsupp.sum_add_hom_single _ _ _⟩, },
971+
{ rintros x ⟨v, rfl⟩,
972+
exact add_submonoid.dfinsupp_sum_add_hom_mem _ v _ (λ i _, (le_supr p i : p i ≤ _) (v i).prop) }
973+
end
974+
975+
lemma _root_.add_submonoid.mem_supr_iff_exists_dfinsupp [add_comm_monoid γ]
976+
(p : ι → add_submonoid γ) (x : γ) :
977+
x ∈ supr p ↔ ∃ f : Π₀ i, p i, dfinsupp.sum_add_hom (λ i, (p i).subtype) f = x :=
978+
set_like.ext_iff.mp (add_submonoid.supr_eq_mrange_dfinsupp_sum_add_hom p) x
979+
980+
/-- A variant of `add_submonoid.mem_supr_iff_exists_dfinsupp` with the RHS fully unfolded. -/
981+
lemma _root_.add_submonoid.mem_supr_iff_exists_dfinsupp' [add_comm_monoid γ]
982+
(p : ι → add_submonoid γ) [Π i (x : p i), decidable (x ≠ 0)] (x : γ) :
983+
x ∈ supr p ↔ ∃ f : Π₀ i, p i, f.sum (λ i xi, ↑xi) = x :=
984+
begin
985+
rw add_submonoid.mem_supr_iff_exists_dfinsupp,
986+
simp_rw sum_add_hom_apply,
987+
congr',
988+
end
989+
961990
omit dec
962991
lemma sum_add_hom_comm {ι₁ ι₂ : Sort*} {β₁ : ι₁ → Type*} {β₂ : ι₂ → Type*} {γ : Type*}
963992
[decidable_eq ι₁] [decidable_eq ι₂] [Π i, add_zero_class (β₁ i)] [Π i, add_zero_class (β₂ i)]

src/linear_algebra/dfinsupp.lean

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,44 @@ end dfinsupp
205205

206206
include dec_ι
207207

208-
lemma submodule.dfinsupp_sum_mem {β : ι → Type*} [Π i, has_zero (β i)]
208+
namespace submodule
209+
210+
lemma dfinsupp_sum_mem {β : ι → Type*} [Π i, has_zero (β i)]
209211
[Π i (x : β i), decidable (x ≠ 0)] (S : submodule R N)
210212
(f : Π₀ i, β i) (g : Π i, β i → N) (h : ∀ c, f c ≠ 0 → g c (f c) ∈ S) : f.sum g ∈ S :=
211213
S.to_add_submonoid.dfinsupp_sum_mem f g h
212214

213-
lemma submodule.dfinsupp_sum_add_hom_mem {β : ι → Type*} [Π i, add_zero_class (β i)]
215+
lemma dfinsupp_sum_add_hom_mem {β : ι → Type*} [Π i, add_zero_class (β i)]
214216
(S : submodule R N) (f : Π₀ i, β i) (g : Π i, β i →+ N) (h : ∀ c, f c ≠ 0 → g c (f c) ∈ S) :
215217
dfinsupp.sum_add_hom g f ∈ S :=
216218
S.to_add_submonoid.dfinsupp_sum_add_hom_mem f g h
219+
220+
/-- The supremum of a family of submodules is equal to the range of `dfinsupp.lsum`; that is
221+
every element in the `supr` can be produced from taking a finite number of non-zero elements
222+
of `p i`, coercing them to `N`, and summing them. -/
223+
lemma supr_eq_range_dfinsupp_lsum (p : ι → submodule R N) :
224+
supr p = (dfinsupp.lsum ℕ (λ i, (p i).subtype)).range :=
225+
begin
226+
apply le_antisymm,
227+
{ apply supr_le _,
228+
intros i y hy,
229+
exact ⟨dfinsupp.single i ⟨y, hy⟩, dfinsupp.sum_add_hom_single _ _ _⟩, },
230+
{ rintros x ⟨v, rfl⟩,
231+
exact dfinsupp_sum_add_hom_mem _ v _ (λ i _, (le_supr p i : p i ≤ _) (v i).prop) }
232+
end
233+
234+
lemma mem_supr_iff_exists_dfinsupp (p : ι → submodule R N) (x : N) :
235+
x ∈ supr p ↔ ∃ f : Π₀ i, p i, dfinsupp.lsum ℕ (λ i, (p i).subtype) f = x :=
236+
set_like.ext_iff.mp (supr_eq_range_dfinsupp_lsum p) x
237+
238+
/-- A variant of `submodule.mem_supr_iff_exists_dfinsupp` with the RHS fully unfolded. -/
239+
lemma mem_supr_iff_exists_dfinsupp' (p : ι → submodule R N) [Π i (x : p i), decidable (x ≠ 0)]
240+
(x : N) :
241+
x ∈ supr p ↔ ∃ f : Π₀ i, p i, f.sum (λ i xi, ↑xi) = x :=
242+
begin
243+
rw mem_supr_iff_exists_dfinsupp,
244+
simp_rw [dfinsupp.lsum_apply_apply, dfinsupp.sum_add_hom_apply],
245+
congr',
246+
end
247+
248+
end submodule

src/linear_algebra/direct_sum_module.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,12 @@ lemma submodule_is_internal.to_add_subgroup {R M : Type*}
167167
submodule_is_internal A ↔ add_subgroup_is_internal (λ i, (A i).to_add_subgroup) :=
168168
iff.rfl
169169

170+
lemma submodule_is_internal.supr_eq_top {R M : Type*}
171+
[semiring R] [add_comm_monoid M] [module R M] (A : ι → submodule R M)
172+
(h : submodule_is_internal A) : supr A = ⊤ :=
173+
begin
174+
rw [submodule.supr_eq_range_dfinsupp_lsum, linear_map.range_eq_top],
175+
exact function.bijective.surjective h,
176+
end
177+
170178
end direct_sum

0 commit comments

Comments
 (0)