-
Notifications
You must be signed in to change notification settings - Fork 344
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
feat(Mathlib/Combinatorics/Nullstellensatz) : Alon's Combinatorial Nullstellensatz #16177
base: master
Are you sure you want to change the base?
Conversation
PR summary 4d882612be
|
Files | Import difference |
---|---|
Mathlib.Data.Finsupp.MonomialOrder.DegLex (new file) |
872 |
Mathlib.RingTheory.MvPolynomial.MonomialOrder (new file) |
1102 |
Mathlib.RingTheory.MvPolynomial.Groebner (new file) |
1103 |
Mathlib.RingTheory.MvPolynomial.MonomialOrder.DegLex (new file) |
1105 |
Mathlib.Combinatorics.Nullstellensatz (new file) |
1120 |
Declarations diff
+ Alon1
+ Alon2
+ DegLex.exists_iff
+ DegLex.forall_iff
+ DegLex.isStrictOrder
+ DegLex.le_iff
+ DegLex.linearOrder
+ DegLex.lt_def
+ DegLex.lt_iff
+ DegLex.monotone_degree
+ DegLex.orderBot
+ DegLex.partialOrder
+ DegLex.rec
+ DegLex.single_antitone
+ DegLex.single_le_iff
+ DegLex.single_lt_iff
+ DegLex.single_strictAnti
+ DegLex.wellFounded
+ DegLex.wellFoundedLT
+ Lex.single_antitone
+ Lex.single_le_iff
+ Lex.single_lt_iff
+ Lex.single_strictAnti
+ MonomialOrder.degLex
+ MonomialOrder.degLex_le_iff
+ MonomialOrder.degLex_lt_iff
+ MonomialOrder.degLex_single_le_iff
+ MonomialOrder.degLex_single_lt_iff
+ MonomialOrder.lex_unit_le_iff
+ MonomialOrder.lex_unit_lt_iff
+ _root_.MonomialOrder.degree_binomial
+ _root_.MonomialOrder.lCoeff_binomial
+ _root_.MonomialOrder.prod_degree
+ _root_.Polynomial.eq_zero_of_eval_zero
+ coeff_degree_eq_zero_iff
+ coeff_degree_ne_zero_iff
+ coeff_eq_zero_of_lt
+ coeff_mul_of_add_of_degree_le
+ coeff_mul_of_degree_add
+ coeff_prod_of_sum_degree
+ degLex_def
+ degLex_degree_degree
+ degLex_totalDegree_monotone
+ degree_C
+ degree_X
+ degree_X_le
+ degree_add
+ degree_add_le
+ degree_add_of_lt
+ degree_add_of_ne
+ degree_apply_single
+ degree_eq_zero_iff_totalDegree_eq_zero
+ degree_le_iff
+ degree_lt_iff
+ degree_monomial
+ degree_monomial_le
+ degree_mul
+ degree_mul_le
+ degree_mul_of_isRegular_left
+ degree_mul_of_isRegular_right
+ degree_mul_of_nonzero_mul
+ degree_neg
+ degree_of_not_nontrivial
+ degree_prod
+ degree_prod_le
+ degree_prod_of_regular
+ degree_reduce_lt
+ degree_single
+ degree_smul
+ degree_smul_le
+ degree_sub_LTerm_le
+ degree_sub_LTerm_lt
+ degree_sub_le
+ degree_sub_of_lt
+ div
+ div_set
+ eq_C_of_degree_eq_zero
+ eq_zero_of_eval_zero_at_prod
+ eq_zero_of_eval_zero_at_prod_nat
+ instance :
+ instance : OrderedCancelAddCommMonoid (DegLex (α →₀ ℕ))
+ instance [AddCommMonoid α] :
+ instance [LT α] : LT (DegLex (α →₀ ℕ))
+ lCoeff
+ lCoeff_add_of_lt
+ lCoeff_eq_zero_iff
+ lCoeff_is_unit_iff
+ lCoeff_monomial
+ lCoeff_mul
+ lCoeff_mul_of_isRegular_left
+ lCoeff_mul_of_isRegular_right
+ lCoeff_ne_zero_iff
+ lCoeff_of_not_nontrivial
+ lCoeff_prod_of_regular
+ lCoeff_sub_of_lt
+ lCoeff_zero
+ le_degree
+ ofDegLex
+ ofDegLex_add
+ ofDegLex_inj
+ ofDegLex_injective
+ ofDegLex_symm_eq
+ ofDegLex_toDegLex
+ reduce
+ subLTerm
+ sup_mem_of_nonempty
+ toDegLex
+ toDegLex_add
+ toDegLex_inj
+ toDegLex_injective
+ toDegLex_ofDegLex
+ toDegLex_symm_eq
+ weight_apply_single
+ weight_single_apply
+ weight_single_one_apply
+ weightedTotalDegree_rename_of_injective
++ DegLex
-++ degree
-++ degree_zero
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 therelative
value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
There was a problem hiding this 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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 383 to 388 in b2327b3
(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 🐶
ext m |
[lint-style] reported by reviewdog 🐶
| succ n hrec => |
[lint-style] reported by reviewdog 🐶
suffices Q = 0 by |
[lint-style] reported by reviewdog 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 402 to 403 in b2327b3
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 🐶
· intro z _ hz |
[lint-style] reported by reviewdog 🐶
· simp |
[lint-style] reported by reviewdog 🐶
intro i |
[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 🐶
intro m hm |
[lint-style] reported by reviewdog 🐶
rintro ⟨u, v⟩ h |
[lint-style] reported by reviewdog 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 520 to 521 in b2327b3
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 🐶
| empty => |
[lint-style] reported by reviewdog 🐶
| @insert a s has h => |
[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 🐶
by_cases h' : d' ≤ b |
[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 🐶
· intro h |
[lint-style] reported by reviewdog 🐶
· simp |
[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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 818 to 822 in b2327b3
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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 826 to 827 in b2327b3
obtain ⟨h, hh, hf⟩ := Alon1 S | |
(fun i ↦ by rw [← Finset.card_pos]; exact lt_of_le_of_lt (zero_le _) (htS i)) |
There was a problem hiding this 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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 388 to 393 in 244d91a
(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 🐶
ext m |
[lint-style] reported by reviewdog 🐶
| succ n hrec => |
[lint-style] reported by reviewdog 🐶
suffices Q = 0 by |
[lint-style] reported by reviewdog 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 407 to 408 in 244d91a
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 🐶
· intro z _ hz |
[lint-style] reported by reviewdog 🐶
· simp |
[lint-style] reported by reviewdog 🐶
intro i |
[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 🐶
intro m hm |
[lint-style] reported by reviewdog 🐶
rintro ⟨u, v⟩ h |
[lint-style] reported by reviewdog 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 525 to 526 in 244d91a
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 🐶
| empty => |
[lint-style] reported by reviewdog 🐶
| @insert a s has h => |
[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 🐶
by_cases h' : d' ≤ b |
[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 🐶
· intro h |
[lint-style] reported by reviewdog 🐶
· simp |
[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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 823 to 827 in 244d91a
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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 831 to 832 in 244d91a
obtain ⟨h, hh, hf⟩ := Alon1 S | |
(fun i ↦ by rw [← Finset.card_pos]; exact lt_of_le_of_lt (zero_le _) (htS i)) |
There was a problem hiding this 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 🐶
· simp |
[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 🐶
by_cases h' : d' ≤ b |
[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 🐶
· intro h |
[lint-style] reported by reviewdog 🐶
· simp |
[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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 1078 to 1082 in 74b2d05
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 🐶
mathlib4/Mathlib/Combinatorics/Nullstellensatz.lean
Lines 1087 to 1088 in 74b2d05
obtain ⟨h, hh, hf⟩ := Alon1 S | |
(fun i ↦ by rw [← Finset.card_pos]; exact lt_of_le_of_lt (zero_le _) (htS i)) |
Co-authored-by: Yaël Dillies <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Prove Alon's Combinatorial Nullstellensatz
Meanwhile, prove several results
Probably, this file should belong to the
RingTheory.MvPolynomial
hierarchy.Question :
Alon1
andAlon2
of the functions are not to stay, but I need suggestions.