Compfiles/Imo2003P5.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

9 declarations, 0 contain sorry, 0 declared as axioms

International Mathematical Olympiad 2003, Problem 5

Given n > 2 and reals x₁ ≤ x₂ ≤ ... ≤ xₙ, show that

(∑ᵢⱼ |xᵢ - xⱼ|)² ≤ (2/3)(n² - 1) ∑ᵢⱼ (xᵢ - xⱼ)².

Show that we have equality iff the sequence is an arithmetic progression.

Imports (9)
Imported by 1 file
  1. theorem Imo2003P5.sum_range_id_real line 61 source

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

    Statement uses: Nat, Eq, Real, Finset.sum, Finset.range, HDiv.hDiv, HMul.hMul, HSub.hSub, OfNat.ofNat

    Proof uses: Nat.recAux, of_eq_true, Eq.trans, True, congrArg, congrFun', Neg.neg, congr, CharP.cast_eq_zero, zero_sub, mul_neg, mul_one, neg_zero, zero_div, eq_self, Eq.mpr, HAdd.hAdd, id, Finset.sum_range_succ, Nat.cast_add and 70 more

    109 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

  2. theorem Imo2003P5.sum_sq_range line 67 source

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

    Statement uses: Nat, Eq, Real, Finset.sum, Finset.range, HPow.hPow, OfNat.ofNat, HDiv.hDiv, HMul.hMul, HSub.hSub

    Proof uses: Nat.recAux, of_eq_true, Eq.trans, True, congrArg, congrFun', Neg.neg, congr, CharP.cast_eq_zero, zero_sub, mul_neg, mul_one, neg_zero, MulZeroClass.mul_zero, zero_div, eq_self, Eq.mpr, HAdd.hAdd, id, Finset.sum_range_succ and 78 more

    115 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

  3. theorem Imo2003P5.sum_coeff The coefficients 2i + 1 - n are centered: their sum vanishes line 74 source

    Source documentation

    The coefficients 2i + 1 - n are centered: their sum vanishes.

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

    Statement uses: Nat, Eq, Real, Finset.sum, Finset.range, HSub.hSub, HAdd.hAdd, HMul.hMul, OfNat.ofNat

    Proof uses: Eq.mpr, HDiv.hDiv, id, congrFun', congrArg, Eq.trans, Finset.sum_sub_distrib, congr, Finset.sum_add_distrib, Imo2003P5.sum_range_id_real, HSMul.hSMul, Finset.card, Finset.sum_const, Finset.card_range, nsmul_eq_mul, Mathlib.Tactic.Ring.of_eq, Mathlib.Tactic.Ring.Common.sub_congr, HPow.hPow, Nat.rawCast, Mathlib.Meta.NormNum.instAddMonoidWithOne' and 69 more

    101 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

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

    theorem sum_coeff (n : ℕ) : ∑ i ∈ range n, (2 * (i : ℝ) + 1 - (n : ℝ)) = 0 := by
    …
  4. theorem Imo2003P5.sum_coeff_mul The sum of the coefficients times the index line 80 source

    Source documentation

    The sum of the coefficients times the index.

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

    Statement uses: Nat, Eq, Real, Finset.sum, Finset.range, HMul.hMul, HSub.hSub, HAdd.hAdd, OfNat.ofNat, HDiv.hDiv, HPow.hPow

    Proof uses: Mathlib.Tactic.Ring.of_eq, Nat.rawCast, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.mul_congr, Mathlib.Tactic.Ring.Common.sub_congr, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.cast_pos, Mathlib.Meta.NormNum.isNat_ofNat, Eq.refl, Mathlib.Meta.NormNum.instAtLeastTwo, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg, Eq.symm, Mathlib.Tactic.Ring.Common.add_mul and 76 more

    102 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

    theorem sum_coeff_mul (n : ℕ) :
        ∑ i ∈ range n, (2 * (i : ℝ) + 1 - (n : ℝ)) * (i : ℝ) = (n : ℝ) * ((n : ℝ) ^ 2 - 1) / 6 := by
    …
  5. theorem Imo2003P5.sum_sq_coeff The sum of the squared coefficients line 89 source

    Source documentation

    The sum of the squared coefficients.

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

    Statement uses: Nat, Eq, Real, Finset.sum, Finset.range, HPow.hPow, HSub.hSub, HAdd.hAdd, HMul.hMul, OfNat.ofNat, HDiv.hDiv

    Proof uses: Mathlib.Tactic.Ring.of_eq, Nat.rawCast, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.pow_congr, Mathlib.Tactic.Ring.Common.sub_congr, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.mul_congr, Mathlib.Tactic.Ring.cast_pos, Mathlib.Meta.NormNum.isNat_ofNat, Eq.refl, Mathlib.Meta.NormNum.instAtLeastTwo, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg, Eq.symm and 85 more

    106 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

    theorem sum_sq_coeff (n : ℕ) :
        ∑ i ∈ range n, (2 * (i : ℝ) + 1 - (n : ℝ)) ^ 2 = (n : ℝ) * ((n : ℝ) ^ 2 - 1) / 3 := by
    …
  6. theorem Imo2003P5.sum_abs_diff The key identity for the sum of absolute differences of a nondecreasing sequence line 99 source

    Source documentation

    The key identity for the sum of absolute differences of a nondecreasing sequence.

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

    Statement uses: Nat, Real, MonotoneOn, Finset, Finset.range, Eq, Finset.sum, abs, HSub.hSub, HMul.hMul, OfNat.ofNat, HAdd.hAdd

    Proof uses: Nat.recAux, of_eq_true, Eq.trans, True, congr, congrArg, Finset.sum_const_zero, EmptyCollection.emptyCollection, funext, congrFun', CharP.cast_eq_zero, sub_zero, MulZeroClass.mul_zero, eq_self, LE.le, Membership.mem, Iff.mpr, LT.lt, Finset.mem_range, LT.lt.trans and 79 more

    117 instances, coercions and auxiliary constants left out.

    Tactic trace: 36 steps

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

    theorem sum_abs_diff : ∀ (n : ℕ) {x : ℕ → ℝ}, MonotoneOn x (range n) →
        ∑ i ∈ range n, ∑ j ∈ range n, |x i - x j| =
          2 * ∑ i ∈ range n, (2 * (i : ℝ) + 1 - (n : ℝ)) * x i := by
    …
  7. theorem Imo2003P5.sum_sq_diff Expansion of the sum of squared differences line 148 source

    Source documentation

    Expansion of the sum of squared differences.

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

    Statement uses: Nat, Real, Eq, Finset.sum, Finset.range, HPow.hPow, HSub.hSub, OfNat.ofNat, HMul.hMul

    Proof uses: HAdd.hAdd, Mathlib.Tactic.Ring.of_eq, Nat.rawCast, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.pow_congr, Mathlib.Tactic.Ring.Common.sub_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg, Eq.symm, Eq.refl, Mathlib.Tactic.Ring.Common.sub_pf, Mathlib.Tactic.Ring.Common.neg_add, Mathlib.Tactic.Ring.Common.neg_mul, Mathlib.Meta.NormNum.IsInt.to_raw_eq and 57 more

    82 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

    theorem sum_sq_diff (n : ℕ) (x : ℕ → ℝ) :
        ∑ i ∈ range n, ∑ j ∈ range n, (x i - x j) ^ 2
          = 2 * (n : ℝ) * ∑ i ∈ range n, x i ^ 2 - 2 * (∑ i ∈ range n, x i) ^ 2 := by
    …
  8. problem Imo2003P5.imo2003_p5 line 159 source

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

    Statement uses: Nat, LT.lt, OfNat.ofNat, Real, MonotoneOn, Finset, Finset.range, LE.le, HPow.hPow, Finset.sum, abs, HSub.hSub, HMul.hMul, HDiv.hDiv

    Proof uses: Ne, Iff.mpr, Nat.cast_ne_zero, Eq, rfl, Membership.mem, Set, sub_le_sub_right, mul_div_cancel₀, Eq.mpr, id, congrFun', congrArg, Finset.sum_congr, Eq.refl, Finset.sum_sub_distrib, HSMul.hSMul, Finset.card, Finset.sum_const, Finset.card_range and 108 more

    145 instances, coercions and auxiliary constants left out.

    Tactic trace: 37 steps

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

  9. problem Imo2003P5.imo2003_p5_equality The equality case: equality holds iff the sequence is an arithmetic progression line 203 source

    Source documentation

    The equality case: equality holds iff the sequence is an arithmetic progression.

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

    Statement uses: Nat, LT.lt, OfNat.ofNat, Real, MonotoneOn, Finset, Finset.range, Iff, Eq, HPow.hPow, Finset.sum, abs, HSub.hSub, HMul.hMul, HDiv.hDiv, Exists, Membership.mem, HAdd.hAdd

    Proof uses: Iff.intro, Ne, Iff.mpr, Nat.cast_ne_zero, rfl, Set, LE.le, sub_le_sub_right, mul_div_cancel₀, Eq.mpr, id, congrFun', congrArg, Finset.sum_congr, Eq.refl, Finset.sum_sub_distrib, HSMul.hSMul, Finset.card, Finset.sum_const, Finset.card_range and 153 more

    203 instances, coercions and auxiliary constants left out.

    Tactic trace: 96 steps

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

    problem imo2003_p5_equality (n : ℕ) (hn : 2 < n) (x : ℕ → ℝ) (hx : MonotoneOn x (range n)) :
        (∑ i ∈ range n, ∑ j ∈ range n, |x i - x j|) ^ 2 =
          2 / 3 * ((n : ℝ) ^ 2 - 1) * ∑ i ∈ range n, ∑ j ∈ range n, (x i - x j) ^ 2 ↔
        ∃ a d : ℝ, ∀ i ∈ range n, x i = a + d * (i : ℝ) := by
    …