Compfiles/Imo1985P3.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
13 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1985, Problem 3
For any polynomial $P(x) = a_0 + a_1x + \dots + a_kx^k$ with integer coefficients, the number of odd coefficients is denoted by $o(P)$. For $i = 0, 1, 2, \dots$ let $Q_i(x) = (1 + x)^i$. Prove that if $i_1, i_2, \dots, i_n$ are integers satisfying $0 \le i_1 < i_2 < \dots < i_n$, then $$o(Q_{i_1} + Q_{i_2} + \dots + Q_{i_n}) \ge o(Q_{i_1}).$$
Imports (6)
Imported by 1 file
- def
Imo1985P3.oddCountThe number of odd coefficients of a polynomial with integer coefficients line 37 sourceSource documentation
The number of odd coefficients of a polynomial with integer coefficients.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,Int,NatProof uses:
Finset.card,Finset.filter,Odd,Finsupp,Polynomial.coeff,Polynomial.support7 instances, coercions and auxiliary constants left out.
noncomputable def oddCount (P : ℤ[X]) : ℕ := …
Mentions: P
- def
Imo1985P3.oo Pis the number of nonzero coefficients of a polynomialPoverZMod 2line 61 sourceSource documentation
o Pis the number of nonzero coefficients of a polynomialPoverZMod 2.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,ZMod,OfNat.ofNat,NatProof uses:
Finset.card,Polynomial.support12 instances, coercions and auxiliary constants left out.
noncomputable def o (P : (ZMod 2)[X]) : ℕ := P.support.card
Mentions: P
- lemma
Imo1985P3.support_X_pow_mulThe support ofX ^ m * pis the support ofpshifted bymline 64 sourceSource documentation
The support of
X ^ m * pis the support ofpshifted bym.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Polynomial,ZMod,OfNat.ofNat,Eq,Finset,Polynomial.support,HMul.hMul,HPow.hPow,Polynomial.X,Finset.image,HAdd.hAddProof uses:
Finset.ext,Eq.mpr,Iff,Membership.mem,Not,ite,LE.le,Finsupp,Polynomial.coeff,HSub.hSub,Exists,And,id,congr,congrArg,Eq.trans,Ne,congrFun',Polynomial.coeff_X_pow_mul',funextand 11 more48 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
lemma support_X_pow_mul (m : ℕ) (p : (ZMod 2)[X]) : (X ^ m * p).support = p.support.image (· + m) := by … - lemma
Imo1985P3.o_add_X_pow_mulIfphas degree less thanm, the supports ofpandX ^ m * qare disjoint, henceo (p + X ^ m * q) = o p + o qline 85 sourceSource documentation
If
phas degree less thanm, the supports ofpandX ^ m * qare disjoint, henceo (p + X ^ m * q) = o p + o q.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Polynomial,ZMod,OfNat.ofNat,LT.lt,Polynomial.natDegree,Eq, Imo1985P3.o,HAdd.hAdd,HMul.hMul,HPow.hPow,Polynomial.XProof uses:
Finset,Polynomial.support,Union.union,Finset.Subset.antisymm,Polynomial.support_add,Membership.mem,Eq.mpr,Ne,Finsupp,Polynomial.coeff,id,congrArg,propext,Polynomial.mem_support_iff,Or,Iff.mp,Finset.mem_union,lt_of_le_of_lt,Polynomial.le_natDegree_of_mem_supp,Polynomial.coeff_addand 25 more69 instances, coercions and auxiliary constants left out.
Tactic trace: 27 steps
Open to load the checked before-and-after goal states.
lemma o_add_X_pow_mul {m : ℕ} {p q : (ZMod 2)[X]} (hp : p.natDegree < m) : o (p + X ^ m * q) = o p + o q := by …Mentions: Imo1985P3.o
- lemma
Imo1985P3.o_add_leSubadditivity ofoline 114 sourceSource documentation
Subadditivity of
o.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,ZMod,OfNat.ofNat,Nat,LE.le, Imo1985P3.o,HAdd.hAddProof uses:
le_trans,Finset.card,Union.union,Finset,Polynomial.support,Finset.card_le_card,Polynomial.support_add,Finset.card_union_le22 instances, coercions and auxiliary constants left out.
lemma o_add_le (p q : (ZMod 2)[X]) : o (p + q) ≤ o p + o q := …
Mentions: Imo1985P3.o
- lemma
Imo1985P3.o_le_o_add_addA convenient rearrangement of subadditivity line 118 sourceSource documentation
A convenient rearrangement of subadditivity.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,ZMod,OfNat.ofNat,Nat,LE.le, Imo1985P3.o,HAdd.hAddProof uses:
Eq,Neg.neg,congrArg,Finset,Polynomial.support,Finset.card,Polynomial.support_neg,Trans.trans,Eq.mpr,id,add_neg_cancel_right,Eq.refl, Imo1985P3.o_add_le34 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma o_le_o_add_add (p q : (ZMod 2)[X]) : o p ≤ o (p + q) + o q := by …
Mentions: Imo1985P3.o
- lemma
Imo1985P3.natDegree_one_add_X_powThe degree of(1 + X) ^ ioverZMod 2line 125 sourceSource documentation
The degree of
(1 + X) ^ ioverZMod 2.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Polynomial.natDegree,ZMod,OfNat.ofNat,HPow.hPow,Polynomial,HAdd.hAdd,Polynomial.XProof uses:
RingHom,Polynomial.C,Eq.mpr,id,congrArg,Polynomial.C_1,add_comm,HMul.hMul,Polynomial.Monic.natDegree_pow,Polynomial.monic_X_add_C,Polynomial.natDegree_X_add_C,mul_one,Eq.refl51 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma natDegree_one_add_X_pow (i : ℕ) : ((1 + X : (ZMod 2)[X]) ^ i).natDegree = i := by …
- lemma
Imo1985P3.one_add_X_pow_two_powThe freshman's dream in characteristic $2$:(1 + X) ^ (2 ^ k) = 1 + X ^ (2 ^ k)line 130 sourceSource documentation
The freshman's dream in characteristic $2$:
(1 + X) ^ (2 ^ k) = 1 + X ^ (2 ^ k).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Polynomial,ZMod,OfNat.ofNat,HPow.hPow,HAdd.hAdd,Polynomial.XProof uses:
Eq.mpr,id,congrArg,add_pow_expChar_pow,one_pow,Eq.refl44 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
lemma one_add_X_pow_two_pow (k : ℕ) : (1 + X : (ZMod 2)[X]) ^ 2 ^ k = 1 + X ^ 2 ^ k := by … - lemma
Imo1985P3.oddCount_eq_oThe number of odd coefficients ofP : ℤ[X]equalsoof its image in(ZMod 2)[X]line 136 sourceSource documentation
The number of odd coefficients of
P : ℤ[X]equalsoof its image in(ZMod 2)[X].standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Polynomial,Int,Eq,Nat, Imo1985P3.oddCount, Imo1985P3.o,Polynomial.map,ZMod,OfNat.ofNat,Int.castRingHomProof uses:
id,Finset.card,Finset.filter,Odd,Finsupp,Polynomial.coeff,Polynomial.support,Finset,Eq.rec,Eq.refl,Finset.ext,Eq.mpr,Iff,Membership.mem,And,Ne,congr,congrArg,Eq.trans,congrFun'and 15 more61 instances, coercions and auxiliary constants left out.
Tactic trace: 21 steps
Open to load the checked before-and-after goal states.
lemma oddCount_eq_o (P : ℤ[X]) : oddCount P = o (P.map (Int.castRingHom (ZMod 2))) := by …Mentions: P, Imo1985P3.oddCount, Imo1985P3.o
- lemma
Imo1985P3.map_one_add_X_powThe image of a single power of1 + Xin(ZMod 2)[X]line 158 sourceSource documentation
The image of a single power of
1 + Xin(ZMod 2)[X].standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Polynomial,ZMod,OfNat.ofNat,Polynomial.map,Int,Int.castRingHom,HPow.hPow,HAdd.hAdd,Polynomial.XProof uses:
Eq.mpr,id,congrArg,Polynomial.map_pow,Polynomial.map_add,Polynomial.map_one,Polynomial.map_X,Eq.refl38 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
lemma map_one_add_X_pow (i : ℕ) : ((1 + X : ℤ[X]) ^ i).map (Int.castRingHom (ZMod 2)) = (1 + X : (ZMod 2)[X]) ^ i := by … - lemma
Imo1985P3.map_sum_one_add_X_powThe image of a sum of powers of1 + Xin(ZMod 2)[X]line 163 sourceSource documentation
The image of a sum of powers of
1 + Xin(ZMod 2)[X].standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Eq,Polynomial,ZMod,OfNat.ofNat,Polynomial.map,Int,Int.castRingHom,Finset.sum,HPow.hPow,HAdd.hAdd,Polynomial.XProof uses:
Eq.mpr,id,congrArg,Polynomial.map_sum,Finset.sum_congr,rfl,Membership.mem, Imo1985P3.map_one_add_X_pow42 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma map_sum_one_add_X_pow (S : Finset ℕ) : (∑ i ∈ S, (1 + X : ℤ[X]) ^ i).map (Int.castRingHom (ZMod 2)) = ∑ i ∈ S, (1 + X : (ZMod 2)[X]) ^ i := by …Mentions: S
- lemma
Imo1985P3.keyThe main inequality overZMod 2, proved by strong induction on the largest indexNline 171 sourceSource documentation
The main inequality over
ZMod 2, proved by strong induction on the largest indexN.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,Finset.Nonempty,Eq,Finset.max',LE.le, Imo1985P3.o,HPow.hPow,Polynomial,ZMod,OfNat.ofNat,HAdd.hAdd,Polynomial.X,Finset.min',Finset.sumProof uses:
Nat.strong_induction_on,LT.lt,dite,Singleton.singleton,Iff.mpr,And,Membership.mem,Finset.eq_singleton_iff_nonempty_unique_mem,And.intro,le_trans,Exists.intro,Finset.le_max',le_of_eq,Eq.mpr,id,congrArg,Finset.singleton_nonempty,Finset.min'_singleton,Finset.sum_singleton,le_refland 53 more124 instances, coercions and auxiliary constants left out.
Tactic trace: 108 steps
Open to load the checked before-and-after goal states.
lemma key : ∀ N : ℕ, ∀ (S : Finset ℕ) (hS : S.Nonempty), S.max' hS = N → o ((1 + X : (ZMod 2)[X]) ^ S.min' hS) ≤ o (∑ i ∈ S, (1 + X : (ZMod 2)[X]) ^ i) := …Mentions: S, Imo1985P3.o
- problem
Imo1985P3.imo1985_p3line 291 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Finset.Nonempty,LE.le, Imo1985P3.oddCount,HPow.hPow,Polynomial,Int,HAdd.hAdd,OfNat.ofNat,Polynomial.X,Finset.min',Finset.sumProof uses:
Eq.mpr, Imo1985P3.o,Polynomial.map,ZMod,Int.castRingHom,id,Eq,congrArg, Imo1985P3.oddCount_eq_o, Imo1985P3.map_one_add_X_pow, Imo1985P3.map_sum_one_add_X_pow, Imo1985P3.key,Finset.max',rfl35 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.