Skip to content

[Merged by Bors] - feat: Lemmas for some monomial orders#16177

Closed
AntoineChambert-Loir wants to merge 126 commits intomasterfrom
ACL/CombNS
Closed

[Merged by Bors] - feat: Lemmas for some monomial orders#16177
AntoineChambert-Loir wants to merge 126 commits intomasterfrom
ACL/CombNS

Conversation

@AntoineChambert-Loir
Copy link
Copy Markdown
Collaborator

@AntoineChambert-Loir AntoineChambert-Loir commented Aug 27, 2024

This is a PR of technical lemmas relative to monomial orders and polynomials that were taken out of the formalization of Alon's Combinatorial Nullstellensatz which now belongs to #20495

  • degree of a product for the deglex monomial order, multiplicativity of the leading coefficients
  • degree (for a monomial order) of monomials
  • the leading coefficient (for a monomial order) of a nonzero polynomial is nonzero.

Two other enhancements are delegated to two other PRs on which this one now depends.

Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 27, 2024

PR summary 0f2bb639d4

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.RingTheory.MvPolynomial.MonomialOrder.DegLex (new file) 1140

Declarations diff

+ coeff_mul_of_add_of_degree_le
+ coeff_prod_sum_degree
+ degLex_totalDegree_monotone
+ degree_X
+ degree_X_le_single
+ degree_degLexDegree
+ degree_prod
+ degree_prod_le
+ degree_prod_of_regular
+ leadingCoeff_prod_of_regular

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).

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

lint-style

[lint-style] reported by reviewdog 🐶

theorem eq_zero_of_eval_zero_at_prod_nat {n : ℕ} [IsDomain R]


[lint-style] reported by reviewdog 🐶

(Hdeg : ∀ i, P.weightedTotalDegree (Finsupp.single i 1) < (S i).ncard)
(Heval : ∀ (x : Fin n → R), (∀ i, x i ∈ S i) → eval x P = 0) :
P = 0 := by
induction n generalizing R with
| zero =>
suffices P = C (constantCoeff P) by


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

have Heval' : ∀ (x : Fin n → R) (_ : ∀ i, x i ∈ S i.succ),
Polynomial.map (eval x) Q = 0 := fun x hx ↦ by


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

noncomputable example (s : R) : Polynomial R := Polynomial.X (R := R) - Polynomial.C s


[lint-style] reported by reviewdog 🐶

noncomputable example (S : Finset R) : Polynomial R :=


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

lemma prod_support_le {ι : Type*} (i : ι) (s : Finset R) (m : ι →₀ ℕ)
(hm : m ∈ (s.prod (fun r ↦ X i - C r)).support) :


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

have hf : f = f' + monomial d (f.coeff d) := by


[lint-style] reported by reviewdog 🐶

have hf' : f'.support = f.support.erase d := by


[lint-style] reported by reviewdog 🐶

obtain ⟨h', r', Hf', Hh', Hr'⟩ := hrec f' hf'D


[lint-style] reported by reviewdog 🐶

rw [← ne_eq, ← mem_support_iff]


[lint-style] reported by reviewdog 🐶

-- write `monomial d (f.coeff d) = `monomial d' (f.coeff d) * _ + f''`


[lint-style] reported by reviewdog 🐶

have hf'' : monomial d (f.coeff d)


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

simp only [Finset.mem_antidiagonal]


[lint-style] reported by reviewdog 🐶

obtain ⟨h'', r'', Hf'', Hh'', Hr''⟩ := hrec f'' hf''2


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

(f : MvPolynomial (Fin n) R) (Heval : ∀ (x : Fin n → R), (∀ i, x i ∈ S i) → eval x f = 0) :


[lint-style] reported by reviewdog 🐶

apply eq_zero_of_eval_zero_at_prod_nat r (fun i ↦ S i)


[lint-style] reported by reviewdog 🐶

theorem Alon2 {n : ℕ} [IsDomain R]
(f : MvPolynomial (Fin n) R)
(t : Fin n →₀ ℕ) (ht : f.coeff t ≠ 0) (ht' : f.totalDegree = t.degree)
(S : Fin n → Finset R) (htS : ∀ i, t i < (S i).card) :
∃ (s : Fin n → R) (_ : ∀ i, s i ∈ S i), eval s f ≠ 0 := by


[lint-style] reported by reviewdog 🐶

obtain ⟨h, hh, hf⟩ := Alon1 S
(fun i ↦ by rw [← Finset.card_pos]; exact lt_of_le_of_lt (zero_le _) (htS i))

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

lint-style

[lint-style] reported by reviewdog 🐶

theorem eq_zero_of_eval_zero_at_prod_nat {n : ℕ} [IsDomain R]


[lint-style] reported by reviewdog 🐶

(Hdeg : ∀ i, P.weightedTotalDegree (Finsupp.single i 1) < (S i).ncard)
(Heval : ∀ (x : Fin n → R), (∀ i, x i ∈ S i) → eval x P = 0) :
P = 0 := by
induction n generalizing R with
| zero =>
suffices P = C (constantCoeff P) by


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

have Heval' : ∀ (x : Fin n → R) (_ : ∀ i, x i ∈ S i.succ),
Polynomial.map (eval x) Q = 0 := fun x hx ↦ by


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

noncomputable example (s : R) : Polynomial R := Polynomial.X (R := R) - Polynomial.C s


[lint-style] reported by reviewdog 🐶

noncomputable example (S : Finset R) : Polynomial R :=


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

lemma prod_support_le {ι : Type*} (i : ι) (s : Finset R) (m : ι →₀ ℕ)
(hm : m ∈ (s.prod (fun r ↦ X i - C r)).support) :


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

have hf : f = f' + monomial d (f.coeff d) := by


[lint-style] reported by reviewdog 🐶

have hf' : f'.support = f.support.erase d := by


[lint-style] reported by reviewdog 🐶

obtain ⟨h', r', Hf', Hh', Hr'⟩ := hrec f' hf'D


[lint-style] reported by reviewdog 🐶

rw [← ne_eq, ← mem_support_iff]


[lint-style] reported by reviewdog 🐶

-- write `monomial d (f.coeff d) = `monomial d' (f.coeff d) * _ + f''`


[lint-style] reported by reviewdog 🐶

have hf'' : monomial d (f.coeff d)


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

simp only [Finset.mem_antidiagonal]


[lint-style] reported by reviewdog 🐶

obtain ⟨h'', r'', Hf'', Hh'', Hr''⟩ := hrec f'' hf''2


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

(f : MvPolynomial (Fin n) R) (Heval : ∀ (x : Fin n → R), (∀ i, x i ∈ S i) → eval x f = 0) :


[lint-style] reported by reviewdog 🐶

apply eq_zero_of_eval_zero_at_prod_nat r (fun i ↦ S i)


[lint-style] reported by reviewdog 🐶

theorem Alon2 {n : ℕ} [IsDomain R]
(f : MvPolynomial (Fin n) R)
(t : Fin n →₀ ℕ) (ht : f.coeff t ≠ 0) (ht' : f.totalDegree = t.degree)
(S : Fin n → Finset R) (htS : ∀ i, t i < (S i).card) :
∃ (s : Fin n → R) (_ : ∀ i, s i ∈ S i), eval s f ≠ 0 := by


[lint-style] reported by reviewdog 🐶

obtain ⟨h, hh, hf⟩ := Alon1 S
(fun i ↦ by rw [← Finset.card_pos]; exact lt_of_le_of_lt (zero_le _) (htS i))

@grunweg grunweg changed the title Feat(Mathlib/Combinatorics/Nullstellensatz) : Alon's Combinatorial Nullstellensatz feat(Mathlib/Combinatorics/Nullstellensatz) : Alon's Combinatorial Nullstellensatz Aug 27, 2024
@grunweg grunweg added the t-combinatorics Combinatorics label Aug 27, 2024
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

lint-style

[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

/- theorem euclDivd {n : ℕ} (S : Fin n → Finset R) (Sne : ∀ i, (S i).Nonempty)


[lint-style] reported by reviewdog 🐶

have hf : f = f' + monomial d (f.coeff d) := by


[lint-style] reported by reviewdog 🐶

have hf' : f'.support = f.support.erase d := by


[lint-style] reported by reviewdog 🐶

obtain ⟨h', r', Hf', Hh', Hr'⟩ := hrec f' hf'D


[lint-style] reported by reviewdog 🐶

rw [← ne_eq, ← mem_support_iff]


[lint-style] reported by reviewdog 🐶

-- write `monomial d (f.coeff d) = `monomial d' (f.coeff d) * _ + f''`


[lint-style] reported by reviewdog 🐶

have hf'' : monomial d (f.coeff d)


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

simp only [Finset.mem_antidiagonal]


[lint-style] reported by reviewdog 🐶

obtain ⟨h'', r'', Hf'', Hh'', Hr''⟩ := hrec f'' hf''2


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶


[lint-style] reported by reviewdog 🐶

(f : MvPolynomial σ R) (Heval : ∀ (x : σ → R), (∀ i, x i ∈ S i) → eval x f = 0) :


[lint-style] reported by reviewdog 🐶

apply eq_zero_of_eval_zero_at_prod r (fun i ↦ S i)


[lint-style] reported by reviewdog 🐶

theorem Alon2 [IsDomain R]
(f : MvPolynomial σ R)
(t : σ →₀ ℕ) (ht : f.coeff t ≠ 0) (ht' : f.totalDegree = t.degree)
(S : σ → Finset R) (htS : ∀ i, t i < (S i).card) :
∃ (s : σ → R) (_ : ∀ i, s i ∈ S i), eval s f ≠ 0 := by


[lint-style] reported by reviewdog 🐶

obtain ⟨h, hh, hf⟩ := Alon1 S
(fun i ↦ by rw [← Finset.card_pos]; exact lt_of_le_of_lt (zero_le _) (htS i))

@AntoineChambert-Loir AntoineChambert-Loir removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 31, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels Jan 31, 2025
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 31, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 31, 2025
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks!

maintainer delegate

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jan 31, 2025
Copy link
Copy Markdown
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

If CI passes, please remove the label awaiting-CI and merge this yourself, by adding a comment bors r+.

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 31, 2025

✌️ AntoineChambert-Loir can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Jan 31, 2025
@AntoineChambert-Loir
Copy link
Copy Markdown
Collaborator Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Jan 31, 2025
This is a PR of technical lemmas relative to monomial orders and polynomials that were taken out of the formalization of Alon's Combinatorial Nullstellensatz which now belongs to #20495

* degree of a product for the deglex monomial order, multiplicativity of the leading coefficients
* degree (for a monomial order) of monomials
* the leading coefficient (for a monomial order) of a nonzero polynomial is nonzero.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 31, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Lemmas for some monomial orders [Merged by Bors] - feat: Lemmas for some monomial orders Jan 31, 2025
@mathlib-bors mathlib-bors bot closed this Jan 31, 2025
@mathlib-bors mathlib-bors bot deleted the ACL/CombNS branch January 31, 2025 21:02
Julian added a commit that referenced this pull request Feb 2, 2025
* factorial-dvd-int: (143 commits)
  Apply suggestions from code review
  feat(Factorial): k! divides the product of any k successive integers
  feat(CategoryTheory): creation of finite limits (#21320)
  chore: update Mathlib dependencies 2025-02-01 (#21328)
  chore(GroupTheory/SpecificGroups/Alternating.lean): follow last minute review of JX (#21314)
  feat: `‖x‖ₑ.toNNReal = ‖x‖₊` (#21306)
  chore: cleanup imports in Archive/IfNormalization (#21318)
  doc: fix several typos (#21315)
  feat(CategoryTheory): transfer being iso along an iso in the arrow category (#21310)
  chore: delete declarations deprecated between 2024-01 and 2024-07 (#21271)
  feat(Analysis/Normed/Module/Dual): polar in a normed space as a submodule (#20084)
  chore(Data/ZMod/Basic): split `ZMod.valMinAbs` off (#21308)
  feat(GroupTheory/Perm/Centralizer): study the centralizer of a permutation (#17522)
  feat(RingTheory/LocalRing): `IsLocalRing` for subrings (#21168)
  chore: update Mathlib dependencies 2025-02-01 (#21312)
  chore: update Mathlib dependencies 2025-01-31 (#21311)
  feat: generalize `mem_dite` to `Membership α β` (#21262)
  feat: Lemmas for some monomial orders (#16177)
  feat(CategoryTheory): the localized category is monoidal (#12728)
  feat: add function log⁺ (=positive part of the logarithm) and prove standard estimates (#21289)
  feat(RingTheory/WittVector): ring of Witt vectors is p-adically complete (#21295)
  feat(GroupTheory/GroupAction/Blocks): more on blocks (#21284)
  fix(FieldTheory/KrullTopology): make `krullTopology_discreteTopology_of_finiteDimensional` universe polymorphic (#21299)
  feat(RingTheory/Artinian): integral non-zero-divisors are units over artinian rings (#21199)
  refactor(Topology/Gluing): simplify definition of `TopCat.GlueData.Rel` (#20653)
  feat(RingTheory/PowerSeries): binomial series (#20192)
  chore(Mathlib/RingTheory/MvPolynomial): rename MonomiaOrder.lCoeff to MonomialOrder.leadingCoeff  (#21290)
  chore (RingTheory/HahnSeries): fix names that use coeff (#21279)
  feat: let `notation3` distinguish `Prop` vs `Type _ ` vs `Sort _` (#21233)
  chore(MeasureTheory/Function/StronglyMeasurable): split Basic into Basic and AEStronglyMeasurable (#21273)
  feat(CategoryTheory): the monoidal category structure on a localization (#20951)
  feat(Analysis/Complex/Hadamard): generalize Hadamard's three lines theorem (#15009)
  feat(Order/CompleteBooleanAlgebra): Himp in terms of sSup (#20328)
  feat(ENNReal/Basic): add `ofNat_ne_top` and `top_ne_ofNat` (#14486)
  feat: Function.const as a PartialEquiv (#21137)
  chore(NonZeroDivisors): don't import rings (#20871)
  feat(Data/Set/Lattice): insert distributivity with iUnion/iInter (#21267)
  feat(GroupTheory/SpecificGroups/AlternatingGroup): subgroups of index 2 of Equiv.Perm (#21190)
  feat(GroupTheory/GroupAction/Transitive): basic results on transitive actions (#21285)
  perf(MeasureTheory/Function/LpSpace.lean): speed up (#21179)
  feat(Order): order isomorphisms from `Fin n` for small `n` (#21120)
  refactor(Topology/Group): turn morphisms in ProfiniteGrp into one field structures (#20740)
  feat: Sylow's first theorem for elementary `p`-groups (#21072)
  chore(Submonoid/Membership): don't import `MonoidWithZero` (#20748)
  refactor(Algebra/Algebra/Pi): cleanup and renaming (#21213)
  feat(GroupTheory/IndexNormal): subgroups of small index are normal (#21186)
  feat(Algebra/Group/Action): add definition of equidecomposition (#16936)
  feat(CategoryTheory/Subpresheaf): equalizer (#21096)
  feat: add lemmas about products of `Matrix.stdBasisMatrix` (#21204)
  chore: update Mathlib dependencies 2025-01-31 (#21282)
  ...
jt496 pushed a commit that referenced this pull request Feb 3, 2025
This is a PR of technical lemmas relative to monomial orders and polynomials that were taken out of the formalization of Alon's Combinatorial Nullstellensatz which now belongs to #20495

* degree of a product for the deglex monomial order, multiplicativity of the leading coefficients
* degree (for a monomial order) of monomials
* the leading coefficient (for a monomial order) of a nonzero polynomial is nonzero.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants