Compfiles/Imo2003P5.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
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
- theorem
Imo2003P5.sum_range_id_realline 61 sourcestandard 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.ofNatProof 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_addand 70 more109 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- theorem
Imo2003P5.sum_sq_rangeline 67 sourcestandard 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.hSubProof 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_succand 78 more115 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- theorem
Imo2003P5.sum_coeffThe coefficients2i + 1 - nare centered: their sum vanishes line 74 sourceSource documentation
The coefficients
2i + 1 - nare 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.ofNatProof 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 more101 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 …
- theorem
Imo2003P5.sum_coeff_mulThe sum of the coefficients times the index line 80 sourceSource 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.hPowProof 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_muland 76 more102 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 … - theorem
Imo2003P5.sum_sq_coeffThe sum of the squared coefficients line 89 sourceSource 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.hDivProof 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.symmand 85 more106 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 … - theorem
Imo2003P5.sum_abs_diffThe key identity for the sum of absolute differences of a nondecreasing sequence line 99 sourceSource 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.hAddProof 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.transand 79 more117 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 … - theorem
Imo2003P5.sum_sq_diffExpansion of the sum of squared differences line 148 sourceSource 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.hMulProof 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_eqand 57 more82 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 … - problem
Imo2003P5.imo2003_p5line 159 sourcestandard 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.hDivProof 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_rangeand 108 more145 instances, coercions and auxiliary constants left out.
Tactic trace: 37 steps
Open to load the checked before-and-after goal states.
- problem
Imo2003P5.imo2003_p5_equalityThe equality case: equality holds iff the sequence is an arithmetic progression line 203 sourceSource 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.hAddProof 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_rangeand 153 more203 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 …