Compfiles/Usa1988P5.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned compfiles documentation, Pinned compfiles corpus index
24 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1988, Problem 5
Let p(x) be the polynomial (1 - x)ᵃ (1 - x²)ᵇ (1 - x³)ᶜ ... (1 - x³²)ᵏ, where a, b, ..., k are integers. When expanded in powers of x, the coefficient of x¹ is -2 and the coefficients of x², x³, ... , x³² are all zero. Find k.
Imports (4)
Imported by 1 file
- def
Usa1988P5.prodFormThe polynomialp(x) = ∏_{i = 1}^{32} (1 - X^i) ^ (a i)line 34 sourceSource documentation
The polynomial
p(x) = ∏_{i = 1}^{32} (1 - X^i) ^ (a i). The exponenta 32of the last factor is thekof the problem. (We take the exponents to be natural numbers; the coefficient conditions force every exponent to be positive anyway.)standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Polynomial,RatProof uses:
Finset.prod,Finset.Icc,OfNat.ofNat,HPow.hPow,HSub.hSub,Polynomial.X19 instances, coercions and auxiliary constants left out.
noncomputable def prodForm (a : ℕ → ℕ) : ℚ[X] := ∏ i ∈ Finset.Icc 1 32, (1 - X ^ i) ^ a i …
- def
Usa1988P5.nextAThe effect of one doubling stepp(x) ↦ p(x) p(-x)on the exponents: ifp = ∏ (1 - X^i) ^ (a i)thenp(x) p(-x) = q(x²)whereq = ∏ (1 - X^i) ^ (nextA a i)line 41 sourceSource documentation
The effect of one doubling step
p(x) ↦ p(x) p(-x)on the exponents: ifp = ∏ (1 - X^i) ^ (a i)thenp(x) p(-x) = q(x²)whereq = ∏ (1 - X^i) ^ (nextA a i).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
HAdd.hAdd,ite,Odd,OfNat.ofNat,HMul.hMul7 instances, coercions and auxiliary constants left out.
def nextA (a : ℕ → ℕ) (j : ℕ) : ℕ := (if Odd j then a j else 0) + 2 * a (2 * j)
- def
Usa1988P5.GoodGood p c mexpressesp = 1 + c * X + O(X^(m+1))line 44 sourceSource documentation
Good p c mexpressesp = 1 + c * X + O(X^(m+1)).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,Rat,NatProof uses:
And,Eq,Finsupp,Polynomial.coeff,OfNat.ofNat,LE.le9 instances, coercions and auxiliary constants left out.
def Good (p : ℚ[X]) (c : ℚ) (m : ℕ) : Prop := …
- lemma
Usa1988P5.coeff_comp_neg_Xline 47 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,Rat,Nat,Eq,Finsupp,Polynomial.coeff,Polynomial.comp,Neg.neg,Polynomial.X,HMul.hMul,HPow.hPow,OfNat.ofNatProof uses:
Polynomial.induction_on',Eq.mpr,HAdd.hAdd,id,congrArg,Polynomial.add_comp,Polynomial.coeff_add,mul_add,Eq.refl,LinearMap,RingHom.id,Polynomial.monomial,RingHom,Polynomial.C,Eq.symm,Polynomial.C_mul_X_pow_eq_monomial,Polynomial.mul_comp,Polynomial.C_comp,Polynomial.pow_comp,Polynomial.X_compand 24 more99 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_comp_X_sqline 63 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,Rat,Nat,Eq,Finsupp,Polynomial.coeff,Polynomial.comp,HPow.hPow,Polynomial.X,OfNat.ofNat,HMul.hMulProof uses:
Polynomial.induction_on',Eq.mpr,HAdd.hAdd,id,congrArg,Polynomial.add_comp,Polynomial.coeff_add,Eq.refl,LinearMap,RingHom.id,Polynomial.monomial,RingHom,Polynomial.C,Eq.symm,Polynomial.C_mul_X_pow_eq_monomial,Polynomial.mul_comp,Polynomial.C_comp,Polynomial.pow_comp,Polynomial.X_comp,pow_muland 7 more43 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_one_sub_powBinomial expansion of the coefficients of(1 - X^n)^aline 77 sourceSource documentation
Binomial expansion of the coefficients of
(1 - X^n)^a.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,OfNat.ofNat,Polynomial.X,Finset.sum,Finset.range,HAdd.hAdd,ite,HMul.hMul,Neg.neg,Nat.chooseProof uses:
Eq.mpr,id,congrArg,sub_eq_add_neg,add_comm,add_pow,Polynomial.finsetSum_coeff,Finset.sum_congr,rfl,Finset,Membership.mem,RingHom,Polynomial.C,of_eq_true,Eq.trans,True,neg_mul,one_mul,eq_self,mul_powand 20 more136 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
lemma coeff_one_sub_pow (n a k : ℕ) : ((1 - X ^ n) ^ a : ℚ[X]).coeff k = ∑ j ∈ Finset.range (a + 1), if j * n = k then (-1 : ℚ) ^ j * (a.choose j : ℚ) else 0 := by … - lemma
Usa1988P5.coeff_zero_factorline 96 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,Polynomial.XProof uses:
Eq.mpr,Polynomial.eval,id,congrArg,Polynomial.coeff_zero_eq_eval_zero,Polynomial.eval_pow,Polynomial.eval_sub,Polynomial.eval_one,Polynomial.eval_X,zero_pow,of_eq_true,Eq.trans,True,congrFun',sub_zero,one_pow,eq_self62 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_one_factorline 102 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,Polynomial.XProof uses:
Eq.mpr,Finset.sum,Finset.range,HAdd.hAdd,ite,HMul.hMul,Neg.neg,Nat.choose,id,congrArg, Usa1988P5.coeff_one_sub_pow,Finset.sum_eq_zero,Membership.mem,Finset,dite,False.elim,GT.gt,Or,False,Nat.eq_zero_or_posand 10 more64 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_two_factorline 115 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,Polynomial.XProof uses:
Eq.mpr,Finset.sum,Finset.range,HAdd.hAdd,ite,HMul.hMul,Neg.neg,Nat.choose,id,congrArg, Usa1988P5.coeff_one_sub_pow,Finset.sum_eq_zero,Membership.mem,Finset,dite,False.elim,GT.gt,Or,False,Nat.eq_zero_or_posand 10 more66 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_zero_one_sub_Xline 128 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,OfNat.ofNat,Polynomial.XProof uses:
Eq.mpr,id,congrArg,of_eq_true,Eq.trans,True,pow_one,eq_self, Usa1988P5.coeff_zero_factor,le_refl37 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_one_one_sub_Xline 132 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,OfNat.ofNat,Polynomial.X,Neg.negProof uses:
Eq.mpr,id,congrArg,of_eq_true,Eq.trans,True,pow_one,eq_self,Finset.sum,Finset.range,HAdd.hAdd,ite,HMul.hMul,Nat.choose, Usa1988P5.coeff_one_sub_pow,GT.gt,Or,Nat.eq_zero_or_pos,congr,Membership.memand 26 more93 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_two_one_sub_Xline 144 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,OfNat.ofNat,Polynomial.X,Nat.chooseProof uses:
Eq.mpr,id,congrArg,of_eq_true,Eq.trans,True,pow_one,eq_self,Finset.sum,Finset.range,HAdd.hAdd,ite,HMul.hMul,Neg.neg, Usa1988P5.coeff_one_sub_pow,dite,LE.le,Finset.sum_eq_single,Membership.mem,Finsetand 17 more84 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_two_one_sub_X_sqline 161 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finsupp,Polynomial.coeff,HPow.hPow,Polynomial,HSub.hSub,OfNat.ofNat,Polynomial.X,Neg.negProof uses:
Eq.mpr,Finset.sum,Finset.range,HAdd.hAdd,ite,HMul.hMul,Nat.choose,id,congrArg, Usa1988P5.coeff_one_sub_pow,GT.gt,Or,Nat.eq_zero_or_pos,of_eq_true,Eq.trans,True,congr,Membership.mem,Finset,Singleton.singletonand 25 more102 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_mul_twoline 174 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,Rat,Eq,Finsupp,Nat,Polynomial.coeff,HMul.hMul,OfNat.ofNat,HAdd.hAddProof uses:
Eq.mpr,Finset.sum,Prod,Finset.HasAntidiagonal.antidiagonal,Prod.fst,Prod.snd,id,congrArg,Polynomial.coeff_mul,Finset,Insert.insert,Prod.mk,Singleton.singleton,of_decide_eq_true,Bool,Decidable.decide,Bool.true,Eq.refl,Finset.sum_insert,Notand 3 more42 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_zero_prodline 183 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Polynomial,Rat,Membership.mem,Eq,Finsupp,Polynomial.coeff,OfNat.ofNat,Finset.prodProof uses:
Eq.mpr,Polynomial.eval,id,congrArg,Polynomial.coeff_zero_eq_eval_zero,Polynomial.eval_prod,Finset.prod_eq_one,Eq.symm34 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_one_prodline 192 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Polynomial,Rat,Membership.mem,Eq,Finsupp,Polynomial.coeff,OfNat.ofNat,Finset.prodProof uses:
Finset.induction,EmptyCollection.emptyCollection,of_eq_true,Eq.trans,True,congrFun',congrArg,ite,Polynomial.coeff_one,ite_eq_right_of_eq_false,eq_self,Not,Insert.insert,Finset.mem_insert_of_mem,Eq.mpr,HMul.hMul,id,Finset.prod_insert,HAdd.hAdd,Polynomial.mul_coeff_oneand 6 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.coeff_two_prodline 210 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Polynomial,Rat,Membership.mem,Eq,Finsupp,Polynomial.coeff,OfNat.ofNat,Finset.prodProof uses:
Finset.induction,EmptyCollection.emptyCollection,of_eq_true,Eq.trans,True,congrFun',congrArg,ite,Polynomial.coeff_one,ite_eq_right_of_eq_false,eq_self,Not,Insert.insert,Finset.mem_insert_of_mem,Eq.mpr,HMul.hMul,id,Finset.prod_insert,HAdd.hAdd, Usa1988P5.coeff_mul_two and 7 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.nextA_supportline 233 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq, Usa1988P5.nextAProof uses:
HMul.hMul,of_eq_true,Eq.trans,True,congrFun',congrArg,HAdd.hAdd,ite,Odd,congr,ite_congr,Eq.refl,Not,ite_self,MulZeroClass.mul_zero,add_zero,eq_self16 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.nextA_evenline 239 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Not,Odd,Eq, Usa1988P5.nextA,HMul.hMul,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,True,congrFun',congrArg,HAdd.hAdd,ite,ite_eq_right_of_eq_false,eq_false,zero_add,eq_self13 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1988P5.prod_doubleThe doubling step, at the level of the product representation:(∏ (1 - X^i)^(a i)) · (∏ (1 - X^i)^(a i)).comp (-X)equals(∏ (1 - X^i)^(nextA a i)).comp (X^2)line 246 sourceSource documentation
The doubling step, at the level of the product representation:
(∏ (1 - X^i)^(a i)) · (∏ (1 - X^i)^(a i)).comp (-X)equals(∏ (1 - X^i)^(nextA a i)).comp (X^2).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,Polynomial,Rat,HMul.hMul, Usa1988P5.prodForm,Polynomial.comp,Neg.neg,Polynomial.X, Usa1988P5.nextA,HPow.hPowProof uses:
Finset.prod,Finset.Icc,HSub.hSub,Eq.mpr,id,congrArg,Usa1988P5.prodForm.eq_1,Polynomial.prod_comp,Eq.symm,Finset.prod_mul_distrib,Finset.prod_congr,rfl,Finset,Membership.mem,Polynomial.pow_comp,Polynomial.sub_comp,Polynomial.one_comp,Polynomial.X_comp,mul_pow,Eq.refland 90 more108 instances, coercions and auxiliary constants left out.
Tactic trace: 73 steps
Open to load the checked before-and-after goal states.
lemma prod_double {a : ℕ → ℕ} (ha : ∀ i, 32 < i → a i = 0) : prodForm a * (prodForm a).comp (-X) = (prodForm (nextA a)).comp (X ^ 2) := by …Mentions: Usa1988P5.prodForm, Usa1988P5.nextA
- lemma
Usa1988P5.good_transportThe doubling step preserves the1 + c * X + O(X^(m+1))shape, squaring the linear coefficient and halving the range of vanishing line 339 sourceSource documentation
The doubling step preserves the
1 + c * X + O(X^(m+1))shape, squaring the linear coefficient and halving the range of vanishing.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,Rat,Nat,LE.le,OfNat.ofNat, Usa1988P5.Good,Eq,HMul.hMul,Polynomial.comp,Neg.neg,Polynomial.X,HPow.hPow,HDiv.hDivProof uses:
Finsupp,Polynomial.coeff,And, Usa1988P5.coeff_comp_neg_X,And.intro, Usa1988P5.coeff_comp_X_sq,Eq.mpr,id,congrArg,Eq.symm,Eq.mp,MulZeroClass.mul_zero,Polynomial.mul_coeff_zero,of_eq_true,Eq.trans,True,congrFun',pow_zero,mul_one,eq_selfand 79 more115 instances, coercions and auxiliary constants left out.
Tactic trace: 43 steps
Open to load the checked before-and-after goal states.
lemma good_transport {p q : ℚ[X]} {c : ℚ} {m : ℕ} (hm : 2 ≤ m) (hp : Good p c m) (h : p * p.comp (-X) = q.comp (X ^ 2)) : Good q (-c ^ 2) (m / 2) := by …Mentions: Usa1988P5.Good, h
- lemma
Usa1988P5.extractReading off the two lowest coefficients of a product∏ (1 - X^i)^(b i): the exponent of1 - Xis65536and the exponent of1 - X^2is its binomial coefficient line 378 sourceSource documentation
Reading off the two lowest coefficients of a product
∏ (1 - X^i)^(b i): the exponent of1 - Xis65536and the exponent of1 - X^2is its binomial coefficient.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finsupp,Polynomial.coeff, Usa1988P5.prodForm,OfNat.ofNat,Neg.neg,And,Nat.chooseProof uses:
Membership.mem,Finset,Finset.Icc,Eq.mpr,LE.le,id,congrArg,propext,Finset.mem_Icc,Polynomial,Finset.prod,Finset.erase,HPow.hPow,HSub.hSub,Polynomial.X,rfl, Usa1988P5.coeff_zero_prod, Usa1988P5.coeff_zero_factor,Eq.mp,Neand 72 more111 instances, coercions and auxiliary constants left out.
Tactic trace: 84 steps
Open to load the checked before-and-after goal states.
lemma extract {b : ℕ → ℕ} (h1 : (prodForm b).coeff 1 = -65536) (h2 : (prodForm b).coeff 2 = 0) : b 1 = 65536 ∧ b 2 = (65536).choose 2 := by …Mentions: Usa1988P5.prodForm
- determine
Usa1988P5.answerline 463 sourcestandard axioms: propext what this means
Statement uses:
NatProof uses:
HSub.hSub,HPow.hPow,OfNat.ofNat7 instances, coercions and auxiliary constants left out.
- problem
Usa1988P5.usa1988_p5line 465 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finsupp,Polynomial.coeff, Usa1988P5.prodForm,OfNat.ofNat,Neg.neg,LE.le, Usa1988P5.answerProof uses:
ite,Membership.mem,Finset,Finset.Icc,Polynomial,Finset.prod_congr,HPow.hPow,HSub.hSub,Polynomial.X,rfl,Eq.mpr,id,congrArg,ite_eq_left,Eq.refl,LT.lt,Not,And,propext,Finset.mem_Iccand 40 more69 instances, coercions and auxiliary constants left out.
Tactic trace: 50 steps
Open to load the checked before-and-after goal states.