Compfiles/Imo1987P3.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
10 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1987, Problem 3
Let $x_1, x_2, \ldots, x_n$ be real numbers satisfying $x_1^2 + x_2^2 + \cdots + x_n^2 = 1$. Prove that for every integer $k \geq 2$ there are integers $a_1, a_2, \ldots, a_n$, not all zero, such that $|a_i| \leq k - 1$ for all $i$, and $$|a_1 x_1 + a_2 x_2 + \cdots + a_n x_n| \leq \frac{(k - 1)\sqrt{n}}{k^n - 1}.$$
Imports (7)
Imported by 1 file
- def
Imo1987P3.SThe sum∑ i, bᵢ * |x i|attached to a tupleb : Fin n → Fin kof coefficients line 50 sourceSource documentation
The sum
∑ i, bᵢ * |x i|attached to a tupleb : Fin n → Fin kof coefficients.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,RealProof uses:
Finset.sum,Finset.univ,HMul.hMul,abs9 instances, coercions and auxiliary constants left out.
noncomputable def S {n : ℕ} (x : Fin n → ℝ) {k : ℕ} (b : Fin n → Fin k) : ℝ := … - lemma
Imo1987P3.sum_abs_le_sqrtCauchy-Schwarz:∑ i, |x i| ≤ √nwhenever∑ i, x i ^ 2 = 1line 54 sourceSource documentation
Cauchy-Schwarz:
∑ i, |x i| ≤ √nwhenever∑ i, x i ^ 2 = 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,Eq,Finset.sum,Finset.univ,HPow.hPow,OfNat.ofNat,LE.le,abs,Real.sqrtProof uses:
HMul.hMul,Finset.sum_mul_sq_le_sq_mul_sq,Eq.mpr,id,congrArg,Eq.symm,Finset.sum_congr,rfl,Finset,Membership.mem,sq_abs,Real.le_sqrt_of_sq_le,le_of_not_gt,LT.lt,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HAdd.hAdd,HSub.hSub,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congrand 62 more98 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma sum_abs_le_sqrt {n : ℕ} {x : Fin n → ℝ} (hx : ∑ i, x i ^ 2 = 1) : ∑ i, |x i| ≤ Real.sqrt n := by … - lemma
Imo1987P3.fin_coe_leEvery coefficient ofb : Fin kis at mostk - 1, as a real number line 67 sourceSource documentation
Every coefficient of
b : Fin kis at mostk - 1, as a real number.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,Real,HSub.hSubProof uses:
Nat.le_pred_of_lt,Nat.sub,Fin.isLt,Trans.trans,Eq,cast,Eq.symm,Eq.mpr,id,congrArg,Nat.cast_sub,Nat.cast_one,Eq.refl45 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma fin_coe_le {k : ℕ} (hk : 2 ≤ k) (b : Fin k) : ((b : ℕ) : ℝ) ≤ (k : ℝ) - 1 := by … - lemma
Imo1987P3.fin_coe_le_intEvery coefficient ofb : Fin kis at mostk - 1, as an integer line 73 sourceSource documentation
Every coefficient of
b : Fin kis at mostk - 1, as an integer.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,Int,HSub.hSubProof uses:
Nat.le_pred_of_lt,Nat.sub,Fin.isLt,Trans.trans,Eq,cast,Eq.symm,Eq.mpr,id,congrArg,Nat.cast_sub,Nat.cast_one,Eq.refl37 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma fin_coe_le_int {k : ℕ} (hk : 2 ≤ k) (b : Fin k) : ((b : ℕ) : ℤ) ≤ (k : ℤ) - 1 := by … - lemma
Imo1987P3.S_nonnegline 78 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,LE.le,OfNat.ofNat, Imo1987P3.SProof uses:
Finset.sum_nonneg,HMul.hMul,abs,Finset.univ,Membership.mem,Finset,mul_nonneg,Nat.cast_nonneg',abs_nonneg28 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1987P3.S_leline 81 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,Eq,Finset.sum,Finset.univ,HPow.hPow,OfNat.ofNat,LE.le, Imo1987P3.S,HMul.hMul,HSub.hSub,Real.sqrtProof uses:
cast,Eq.symm,Trans.trans,abs,Finset.sum_le_sum,Membership.mem,Finset,mul_le_mul_of_nonneg_right, Imo1987P3.fin_coe_le,abs_nonneg,Eq.mpr,id,congrArg,Finset.mul_sum,Eq.refl,mul_le_mul_of_nonneg_left, Imo1987P3.sum_abs_le_sqrt,le_of_not_gt,LT.lt,Mathlib.Tactic.Linarith.lt_irrefland 48 more108 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1987P3.floor_min_sub_lePure floor lemma: ifu, v ≤ mhave the same clamped floor, then|u - v| ≤ 1line 94 sourceSource documentation
Pure floor lemma: if
u, v ≤ mhave the same clamped floor, then|u - v| ≤ 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Int,LE.le,Eq,Min.min,Int.floor,HSub.hSub,OfNat.ofNat,absProof uses:
Not,Or,Classical.em,Int.floor_le,LT.lt,HAdd.hAdd,Int.lt_floor_add_one,le_total,Eq.rec,min_le_left,Eq.mp,congrArg,min_eq_left,Int.floor_mono,cast,Eq.symm,le_antisymm,Eq.mpr,Neg.neg,idand 62 more97 instances, coercions and auxiliary constants left out.
Tactic trace: 28 steps
Open to load the checked before-and-after goal states.
lemma floor_min_sub_le {u v : ℝ} {m : ℤ} (hum : u ≤ (m : ℝ)) (hvm : v ≤ (m : ℝ)) (h : min ⌊u⌋ (m - 1) = min ⌊v⌋ (m - 1)) : |u - v| ≤ 1 := by …Mentions: h
- def
Imo1987P3.coefThe choice of integer coefficients: take the differencesbᵢ - b'ᵢ, flipping the sign whereverx i < 0line 118 sourceSource documentation
The choice of integer coefficients: take the differences
bᵢ - b'ᵢ, flipping the sign whereverx i < 0.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,IntProof uses:
HMul.hMul,ite,LE.le,OfNat.ofNat,Neg.neg,HSub.hSub13 instances, coercions and auxiliary constants left out.
noncomputable def coef {n : ℕ} (x : Fin n → ℝ) {k : ℕ} (b b' : Fin n → Fin k) (i : Fin n) : ℤ := … - lemma
Imo1987P3.coef_cast_mulline 121 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,Eq,HMul.hMul, Imo1987P3.coef,HSub.hSub,absProof uses:
id,dite,Int,ite,LE.le,OfNat.ofNat,Neg.neg,Eq.mpr,congrArg,ite_eq_left,abs_of_nonneg,congrFun',Eq.trans,Int.cast_mul,congr,Int.cast_one,Int.cast_sub,Int.cast_natCast,Mathlib.Tactic.Ring.of_eq,HAdd.hAddand 45 more79 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
- problem
Imo1987P3.imo1987_p3line 134 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Fin,Real,Eq,Finset.sum,Finset.univ,HPow.hPow,LE.le,Exists,Int,And,abs,HSub.hSub,Ne,HMul.hMul,HDiv.hDiv,Real.sqrtProof uses:
Eq.mpr,id,congrArg,rfl,Trans.trans,Eq.symm,pow_one,pow_le_pow_right',cast,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HAdd.hAdd,Neg.neg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,Mathlib.Meta.NormNum.instAddMonoidWithOne,inferInstance,Ringand 133 more221 instances, coercions and auxiliary constants left out.
Tactic trace: 101 steps
Open to load the checked before-and-after goal states.