Compfiles/Imo1987P3.lean

GitHub source file

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
  1. def Imo1987P3.S The sum ∑ i, bᵢ * |x i| attached to a tuple b : Fin n → Fin k of coefficients line 50 source

    Source documentation

    The sum ∑ i, bᵢ * |x i| attached to a tuple b : Fin n → Fin k of coefficients.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Fin, Real

    Proof uses: Finset.sum, Finset.univ, HMul.hMul, abs

    9 instances, coercions and auxiliary constants left out.

    noncomputable def S {n : ℕ} (x : Fin n → ℝ) {k : ℕ} (b : Fin n → Fin k) : ℝ :=
    …
  2. lemma Imo1987P3.sum_abs_le_sqrt Cauchy-Schwarz: ∑ i, |x i| ≤ √n whenever ∑ i, x i ^ 2 = 1 line 54 source

    Source documentation

    Cauchy-Schwarz: ∑ i, |x i| ≤ √n whenever ∑ 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.sqrt

    Proof 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_congr and 62 more

    98 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
    …
  3. lemma Imo1987P3.fin_coe_le Every coefficient of b : Fin k is at most k - 1, as a real number line 67 source

    Source documentation

    Every coefficient of b : Fin k is at most k - 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.hSub

    Proof 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.refl

    45 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
    …
  4. lemma Imo1987P3.fin_coe_le_int Every coefficient of b : Fin k is at most k - 1, as an integer line 73 source

    Source documentation

    Every coefficient of b : Fin k is at most k - 1, as an integer.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Fin, Int, HSub.hSub

    Proof 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.refl

    37 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
    …
  5. lemma Imo1987P3.S_nonneg line 78 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Fin, Real, LE.le, OfNat.ofNat, Imo1987P3.S

    Proof uses: Finset.sum_nonneg, HMul.hMul, abs, Finset.univ, Membership.mem, Finset, mul_nonneg, Nat.cast_nonneg', abs_nonneg

    28 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  6. lemma Imo1987P3.S_le line 81 source

    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, Imo1987P3.S, HMul.hMul, HSub.hSub, Real.sqrt

    Proof 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_irrefl and 48 more

    108 instances, coercions and auxiliary constants left out.

    Tactic trace: 8 steps

    Open to load the checked before-and-after goal states.

  7. lemma Imo1987P3.floor_min_sub_le Pure floor lemma: if u, v ≤ m have the same clamped floor, then |u - v| ≤ 1 line 94 source

    Source documentation

    Pure floor lemma: if u, v ≤ m have 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, abs

    Proof 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, id and 62 more

    97 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

  8. def Imo1987P3.coef The choice of integer coefficients: take the differences bᵢ - b'ᵢ, flipping the sign wherever x i < 0 line 118 source

    Source documentation

    The choice of integer coefficients: take the differences bᵢ - b'ᵢ, flipping the sign wherever x i < 0.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Fin, Real, Int

    Proof uses: HMul.hMul, ite, LE.le, OfNat.ofNat, Neg.neg, HSub.hSub

    13 instances, coercions and auxiliary constants left out.

    noncomputable def coef {n : ℕ} (x : Fin n → ℝ) {k : ℕ} (b b' : Fin n → Fin k) (i : Fin n) : ℤ :=
    …
  9. lemma Imo1987P3.coef_cast_mul line 121 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Fin, Real, Eq, HMul.hMul, Imo1987P3.coef, HSub.hSub, abs

    Proof 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.hAdd and 45 more

    79 instances, coercions and auxiliary constants left out.

    Tactic trace: 10 steps

    Open to load the checked before-and-after goal states.

  10. problem Imo1987P3.imo1987_p3 line 134 source

    standard 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.sqrt

    Proof 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, Ring and 133 more

    221 instances, coercions and auxiliary constants left out.

    Tactic trace: 101 steps

    Open to load the checked before-and-after goal states.