Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: generalize more materials about linear independence over semirings #20497

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

alreadydone
Copy link
Contributor

@alreadydone alreadydone commented Jan 5, 2025

Also add Finsupp.linearCombination_one_tmul and linearIndependent_one_tmul that connects linear independence to flatness.


Open in Gitpod

@alreadydone alreadydone added the t-algebra Algebra (groups, rings, fields, etc) label Jan 5, 2025
Copy link

github-actions bot commented Jan 5, 2025

PR summary ebfaf15931

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.RingTheory.AlgebraTower 886 885 -1 (-0.11%)
Import changes for all files
Files Import difference
4 files Mathlib.RingTheory.AlgebraTower Mathlib.LinearAlgebra.Matrix.ToLin Mathlib.Data.Complex.Module Mathlib.RingTheory.TensorProduct.Free
-1

Declarations diff

+ Finsupp.linearCombination_one_tmul
+ linearCombination_smul
+ linearIndependent_one_tmul

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Jan 5, 2025
@mathlib-bors mathlib-bors bot deleted the branch master January 6, 2025 08:25
@mathlib-bors mathlib-bors bot closed this Jan 6, 2025
@mathlib-bors mathlib-bors bot changed the base branch from Semiring_LinearIndependent to master January 6, 2025 08:25
@eric-wieser eric-wieser reopened this Jan 6, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Jan 6, 2025
@mathlib4-dependent-issues-bot
Copy link
Collaborator

This PR/issue depends on:

Comment on lines 52 to +68
theorem LinearIndependent.of_isLocalizedModule {ι : Type*} {v : ι → M}
(hv : LinearIndependent R v) : LinearIndependent Rₛ (f ∘ v) := by
rw [linearIndependent_iff'] at hv ⊢
intro t g hg i hi
choose! a g' hg' using IsLocalization.exist_integer_multiples S t g
have h0 : f (∑ i ∈ t, g' i • v i) = 0 := by
apply_fun ((a : R) • ·) at hg
rw [smul_zero, Finset.smul_sum] at hg
rw [map_sum, ← hg]
refine Finset.sum_congr rfl fun i hi => ?_
rw [← smul_assoc, ← hg' i hi, map_smul, Function.comp_apply, algebraMap_smul]
obtain ⟨s, hs⟩ := (IsLocalizedModule.eq_zero_iff S f).mp h0
simp_rw [Finset.smul_sum, Submonoid.smul_def, smul_smul] at hs
specialize hv t _ hs i hi
rw [← (IsLocalization.map_units Rₛ a).mul_right_eq_zero, ← Algebra.smul_def, ← hg' i hi]
exact (IsLocalization.map_eq_zero_iff S _ _).2 ⟨s, hv⟩

variable [Module Rₛ M] [IsScalarTower R Rₛ M]

theorem LinearIndependent.localization {ι : Type*} {b : ι → M} (hli : LinearIndependent R b) :
rw [linearIndependent_iff'ₛ] at hv ⊢
intro t g₁ g₂ eq i hi
choose! a fg hfg using IsLocalization.exist_integer_multiples S (t.disjSum t) (Sum.elim g₁ g₂)
simp_rw [Sum.forall, Finset.inl_mem_disjSum, Sum.elim_inl, Finset.inr_mem_disjSum, Sum.elim_inr,
Subtype.forall'] at hfg
apply_fun ((a : R) • ·) at eq
simp_rw [← t.sum_coe_sort, Finset.smul_sum, ← smul_assoc, ← hfg,
algebraMap_smul, Function.comp_def, ← map_smul, ← map_sum,
t.sum_coe_sort (f := fun x ↦ fg (Sum.inl x) • v x),
t.sum_coe_sort (f := fun x ↦ fg (Sum.inr x) • v x)] at eq
have ⟨s, eq⟩ := IsLocalizedModule.exists_of_eq (S := S) eq
simp_rw [Finset.smul_sum, Submonoid.smul_def, smul_smul] at eq
have := congr(algebraMap R Rₛ $(hv t _ _ eq i hi))
simpa only [map_mul, (IsLocalization.map_units Rₛ s).mul_right_inj, hfg.1 ⟨i, hi⟩, hfg.2 ⟨i, hi⟩,
Algebra.smul_def, (IsLocalization.map_units Rₛ a).mul_right_inj] using this
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This proof can be golfed using that localizations are flat, but that would mean hundreds more transitive imports ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-algebra Algebra (groups, rings, fields, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants