Compfiles/Imo2000P3.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
27 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2000, Problem 3
Let n ≥ 2 be a positive integer and λ a positive real number. Initially there are n fleas on a horizontal line, not all at the same point. We define a move as choosing two fleas at some points A and B, with A to the left of B, and letting the flea from A jump over the flea from B to the point C so that BC/AB = λ.
Determine all values of λ such that, for any point M on the line and for any initial position of the n fleas, there exists a sequence of moves that will take them all to the right of M.
Imports (7)
Imported by 1 file
- def
Imo2000P3.MoveDocumented declaration: Move line 41 sourceSource documentation
A single move with jump ratio
lam: fleai, sitting at some pointA = x i, jumps over fleajatB = x j(withAto the left ofB) and lands at the pointC = B + lam * (B - A), so thatBC / AB = lam. All other fleas stay put.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,FinProof uses:
Exists,And,LT.lt,Eq,Function.update,HAdd.hAdd,HMul.hMul,HSub.hSub8 instances, coercions and auxiliary constants left out.
def Move (lam : ℝ) {n : ℕ} (x y : Fin n → ℝ) : Prop := … - def
Imo2000P3.ReachableReachable lam x ymeans that configurationycan be reached from configurationxby a finite sequence of moves with jump ratiolamline 46 sourceSource documentation
Reachable lam x ymeans that configurationycan be reached from configurationxby a finite sequence of moves with jump ratiolam.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,FinProof uses:
Relation.ReflTransGen, Imo2000P3.Movedef Reachable (lam : ℝ) {n : ℕ} (x y : Fin n → ℝ) : Prop := … - def
Imo2000P3.AllRightOfDocumented declaration: AllRightOf line 52 sourceSource documentation
The property of
lamin the problem: starting from any initial configuration in which the fleas are not all at the same point, for every pointMon the line there is a finite sequence of moves taking all the fleas strictly to the right ofM.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,RealProof uses:
Fin,Exists,Ne,And, Imo2000P3.Reachable,LT.lt1 instances, coercions and auxiliary constants left out.
def AllRightOf {n : ℕ} (lam : ℝ) : Prop := … - def
Imo2000P3.rightmostThe position of the rightmost flea line 59 sourceSource documentation
The position of the rightmost flea.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,RealProof uses:
iSup1 instances, coercions and auxiliary constants left out.
noncomputable def rightmost {n : ℕ} (x : Fin n → ℝ) : ℝ := ⨆ i, x i - def
Imo2000P3.leftmostThe position of the leftmost flea line 62 sourceSource documentation
The position of the leftmost flea.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,RealProof uses:
iInf1 instances, coercions and auxiliary constants left out.
noncomputable def leftmost {n : ℕ} (x : Fin n → ℝ) : ℝ := ⨅ i, x i - def
Imo2000P3.potentialGerhard Woeginger's potential function: the sum of the distances of the fleas from the rightmost flea line 66 sourceSource documentation
Gerhard Woeginger's potential function: the sum of the distances of the fleas from the rightmost flea.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,RealProof uses:
Finset.sum,Finset.univ,HSub.hSub, Imo2000P3.rightmost4 instances, coercions and auxiliary constants left out.
noncomputable def potential {n : ℕ} (x : Fin n → ℝ) : ℝ := ∑ i, (rightmost x - x i) …Mentions: Imo2000P3.rightmost
- lemma
Imo2000P3.bddAbove_rangeline 72 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,BddAbove,Set.rangeProof uses:
Set.Finite.bddAbove,Set.finite_range11 instances, coercions and auxiliary constants left out.
- lemma
Imo2000P3.bddBelow_rangeline 75 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,BddBelow,Set.rangeProof uses:
Set.Finite.bddBelow,Set.finite_range11 instances, coercions and auxiliary constants left out.
- lemma
Imo2000P3.le_rightmostline 78 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,LE.le, Imo2000P3.rightmostProof uses:
le_ciSup, Imo2000P3.bddAbove_range3 instances, coercions and auxiliary constants left out.
- lemma
Imo2000P3.leftmost_leline 81 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,LE.le, Imo2000P3.leftmostProof uses:
ciInf_le, Imo2000P3.bddBelow_range3 instances, coercions and auxiliary constants left out.
- lemma
Imo2000P3.exists_eq_rightmostline 84 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nonempty,Fin,Real,Exists,Eq, Imo2000P3.rightmostProof uses:
And,Membership.mem,Finset,Finset.univ,LE.le,Finset.exists_max_image,Finset.univ_nonempty,Exists.intro,le_antisymm, Imo2000P3.le_rightmost,ciSup_le,Finset.mem_univ15 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2000P3.exists_eq_leftmostline 89 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nonempty,Fin,Real,Exists,Eq, Imo2000P3.leftmostProof uses:
And,Membership.mem,Finset,Finset.univ,LE.le,Finset.exists_min_image,Finset.univ_nonempty,Exists.intro,le_antisymm,le_ciInf,Finset.mem_univ, Imo2000P3.leftmost_le15 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2000P3.potential_eqline 94 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,Eq, Imo2000P3.potential,HSub.hSub,HMul.hMul, Imo2000P3.rightmost,Finset.sum,Finset.univProof uses:
id,Eq.mpr,congrArg,Finset.sum_sub_distrib,HSMul.hSMul,Finset.card,Finset.sum_const,Fintype.card,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,Eq.refl35 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2000P3.potential_nonnegline 99 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,LE.le,OfNat.ofNat, Imo2000P3.potentialProof uses:
Finset.sum_nonneg,HSub.hSub, Imo2000P3.rightmost,Finset.univ,Membership.mem,Finset,Iff.mpr,sub_nonneg, Imo2000P3.le_rightmost22 instances, coercions and auxiliary constants left out.
- lemma
Imo2000P3.exists_lt_rightmostline 102 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,LT.lt,OfNat.ofNat, Imo2000P3.potential,Exists, Imo2000P3.rightmostProof uses:
Decidable.byContradiction,Not,Eq,Finset.sum_eq_zero,Finset.univ,HSub.hSub,Membership.mem,Finset,Iff.mpr,sub_eq_zero,Eq.symm,le_antisymm, Imo2000P3.le_rightmost,Eq.mp,LE.le,Eq.trans,binderNameHint,forall_congr,False.elim,Falseand 42 more62 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2000P3.potential_posline 110 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,Exists,Ne,LT.lt,OfNat.ofNat, Imo2000P3.potentialProof uses: Imo2000P3.rightmost,
Decidable.byContradiction,Not,False,Eq.trans,le_antisymm, Imo2000P3.le_rightmost,Eq.mp,LE.le,binderNameHint,forall_congr,Eq.symm,Finset.sum_pos',HSub.hSub,Finset.univ,Membership.mem,Finset,Iff.mpr,sub_nonneg,Exists.introand 5 more55 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2000P3.sum_updateline 121 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Real,Eq,Finset.sum,Finset.univ,Function.update,HAdd.hAdd,HSub.hSubProof uses:
Finset.erase,Finset.sum_congr,rfl,Finset,Membership.mem,Function.update_of_ne,Finset.ne_of_mem_erase,Finset.add_sum_erase,Finset.mem_univ,Mathlib.Tactic.Linarith.eq_of_not_lt_of_not_gt,Not.intro,LT.lt,Mathlib.Tactic.Linarith.lt_irrefl,OfNat.ofNat,Eq.mp,Neg.neg,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,HMul.hMuland 44 more65 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2000P3.rightmost_update_of_leline 131 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nonempty,Fin,Real,LE.le,Eq, Imo2000P3.rightmost,Function.updateProof uses:
le_antisymm,ciSup_le,dite,Eq.mpr,id,congrArg,le_of_eq,Function.update_self,Not,Function.update_of_ne, Imo2000P3.le_rightmost,Eq.mp13 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2000P3.move_potential_boundThe key inequality for the necessity direction: a single move decreases the potential by at least(1 / lam - (n - 1))times the amount by which the rightmost flea advances line 147 sourceSource documentation
The key inequality for the necessity direction: a single move decreases the potential by at least
(1 / lam - (n - 1))times the amount by which the rightmost flea advances.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,LT.lt,Fin, Imo2000P3.Move,HMul.hMul,HSub.hSub,HDiv.hDiv, Imo2000P3.rightmost, Imo2000P3.potentialProof uses:
Nonempty,Nonempty.intro,Fin.mk,Exists,And,Eq,Function.update,HAdd.hAdd,Eq.mpr,id,congrArg,rfl,mul_pos,Iff.mpr,sub_pos,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congrand 110 more162 instances, coercions and auxiliary constants left out.
Tactic trace: 62 steps
Open to load the checked before-and-after goal states.
lemma move_potential_bound (hn : 2 ≤ n) {lam : ℝ} (hlam : 0 < lam) {x y : Fin n → ℝ} (h : Move lam x y) : (1 / lam - ((n : ℝ) - 1)) * (rightmost y - rightmost x) ≤ potential x - potential y := by …Mentions: h, Imo2000P3.Move, Imo2000P3.rightmost, Imo2000P3.potential
- lemma
Imo2000P3.reachable_potential_boundThe inequality ofmove_potential_boundtelescopes along any sequence of moves line 213 sourceSource documentation
The inequality of
move_potential_boundtelescopes along any sequence of moves.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,LT.lt,Fin, Imo2000P3.Reachable,HMul.hMul,HSub.hSub,HDiv.hDiv, Imo2000P3.rightmost, Imo2000P3.potentialProof uses:
Relation.ReflTransGen.rec, Imo2000P3.Move,Relation.ReflTransGen,of_eq_true,Eq.trans,True,congr,congrArg,Inv.inv,congrFun',one_div,sub_self,MulZeroClass.mul_zero, Imo2000P3.move_potential_bound,le_of_not_gt,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HAdd.hAdd,inferInstance,AddMonoidWithOneand 69 more108 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma reachable_potential_bound (hn : 2 ≤ n) {lam : ℝ} (hlam : 0 < lam) {x y : Fin n → ℝ} (h : Reachable lam x y) : (1 / lam - ((n : ℝ) - 1)) * (rightmost y - rightmost x) ≤ potential x - potential y := by …Mentions: h, Imo2000P3.Reachable, Imo2000P3.rightmost, Imo2000P3.potential
- lemma
Imo2000P3.not_allRightOf_of_ltNecessity: if0 < lam < 1 / (n - 1), then the rightmost flea stays bounded, so the fleas cannot all be moved arbitrarily far to the right line 226 sourceSource documentation
Necessity: if
0 < lam < 1 / (n - 1), then the rightmost flea stays bounded, so the fleas cannot all be moved arbitrarily far to the right.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,LT.lt,HDiv.hDiv,HSub.hSub,Not, Imo2000P3.AllRightOfProof uses:
Nonempty,Fin,Nonempty.intro,Fin.mk,cast,Eq.symm,Eq.trans,congrFun',congrArg,Nat.cast_one,lt_of_lt_of_le,one_lt_two,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HAdd.hAdd,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,HMul.hMuland 89 more140 instances, coercions and auxiliary constants left out.
Tactic trace: 40 steps
Open to load the checked before-and-after goal states.
lemma not_allRightOf_of_lt (hn : 2 ≤ n) {lam : ℝ} (hlam : 0 < lam) (hlt : lam < 1 / ((n : ℝ) - 1)) : ¬ AllRightOf (n := n) lam := by …Mentions: Imo2000P3.AllRightOf
- lemma
Imo2000P3.strat_stepOne step of Woeginger's strategy: move the leftmost flea over the rightmost flea line 264 sourceSource documentation
One step of Woeginger's strategy: move the leftmost flea over the rightmost flea. The rightmost flea advances by at least
lam * potential x / (n - 1), and the potential does not decrease.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,HDiv.hDiv,HSub.hSub,Fin,LT.lt, Imo2000P3.potential,Exists,And, Imo2000P3.Move,HAdd.hAdd, Imo2000P3.rightmost,HMul.hMulProof uses:
Nonempty,Nonempty.intro,Fin.mk,cast,Eq.symm,Eq.trans,congrFun',congrArg,Nat.cast_one,lt_of_lt_of_le,one_lt_two,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,HPow.hPow,Int.rawCast,inferInstanceand 108 more164 instances, coercions and auxiliary constants left out.
Tactic trace: 67 steps
Open to load the checked before-and-after goal states.
lemma strat_step (hn : 2 ≤ n) {lam : ℝ} (hlam : 1 / ((n : ℝ) - 1) ≤ lam) (x : Fin n → ℝ) (hp : 0 < potential x) : ∃ y, Move lam x y ∧ rightmost x + lam * potential x / ((n : ℝ) - 1) ≤ rightmost y ∧ potential x ≤ potential y := by …Mentions: Imo2000P3.potential, Imo2000P3.Move, Imo2000P3.rightmost
- lemma
Imo2000P3.phase1Phase 1 of the strategy: aftertmoves ofstrat_step, the rightmost flea has advanced by at leastttimes the fixed positive amountlam * potential x / (n - 1)line 331 sourceSource documentation
Phase 1 of the strategy: after
tmoves ofstrat_step, the rightmost flea has advanced by at leastttimes the fixed positive amountlam * potential x / (n - 1).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,HDiv.hDiv,HSub.hSub,Fin,LT.lt, Imo2000P3.potential,Exists,And, Imo2000P3.Reachable,HAdd.hAdd, Imo2000P3.rightmost,HMul.hMulProof uses:
Nat.recAux,Exists.intro,And.intro,Relation.ReflTransGen.refl, Imo2000P3.Move,le_rfl,of_eq_true,Eq.trans,True,congrFun',congrArg,CharP.cast_eq_zero,MulZeroClass.zero_mul,add_zero, Imo2000P3.strat_step,lt_of_lt_of_le,cast,Eq.symm,Nat.cast_one,one_lt_twoand 77 more145 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
lemma phase1 (hn : 2 ≤ n) {lam : ℝ} (hlam : 1 / ((n : ℝ) - 1) ≤ lam) (x : Fin n → ℝ) (hp : 0 < potential x) (t : ℕ) : ∃ y, Reachable lam x y ∧ potential x ≤ potential y ∧ rightmost x + (t : ℝ) * (lam * potential x / ((n : ℝ) - 1)) ≤ rightmost y := by …Mentions: Imo2000P3.potential, Imo2000P3.Reachable, Imo2000P3.rightmost
- lemma
Imo2000P3.phase2Documented declaration: phase2 line 354 sourceSource documentation
Phase 2 of the strategy: if the rightmost flea is already to the right of
M, then one can move every remaining flea to the right ofM, one at a time, by jumping it over the rightmost flea.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,LT.lt,Fin,Finset.card,Finset.filter,Finset.univ, Imo2000P3.rightmost,Exists,And, Imo2000P3.ReachableProof uses:
Nat.recAux,Eq,Finset,EmptyCollection.emptyCollection,Iff.mp,Finset.card_eq_zero,Nat.le_zero,Exists.intro,And.intro,Relation.ReflTransGen.refl, Imo2000P3.Move,Not,Membership.mem,Eq.mpr,id,congrArg,of_eq_true,Eq.trans,False,Trueand 94 more107 instances, coercions and auxiliary constants left out.
Tactic trace: 65 steps
Open to load the checked before-and-after goal states.
lemma phase2 (hn : 2 ≤ n) {lam : ℝ} (hlam : 0 < lam) (M : ℝ) : ∀ m : ℕ, ∀ y : Fin n → ℝ, (univ.filter fun k => y k ≤ M).card ≤ m → M < rightmost y → ∃ z, Reachable lam y z ∧ ∀ l, M < z l := by …Mentions: Imo2000P3.rightmost, Imo2000P3.Reachable
- lemma
Imo2000P3.allRightOf_of_geDocumented declaration: allRightOf_of_ge line 421 sourceSource documentation
Sufficiency: if
1 / (n - 1) ≤ lam, then Woeginger's strategy (first move the rightmost flea far enough to the right by repeatedly jumping the leftmost flea over it, then jump every other flea over the rightmost flea) takes all fleas to the right of any given pointM.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,HDiv.hDiv,HSub.hSub, Imo2000P3.AllRightOfProof uses:
Nonempty,Fin,Nonempty.intro,Fin.mk,LT.lt,cast,Eq.symm,Eq.trans,congrFun',congrArg,Nat.cast_one,lt_of_lt_of_le,one_lt_two,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HAdd.hAdd,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCastand 85 more134 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
lemma allRightOf_of_ge (hn : 2 ≤ n) {lam : ℝ} (hlam : 1 / ((n : ℝ) - 1) ≤ lam) : AllRightOf (n := n) lam := by …Mentions: Imo2000P3.AllRightOf
- determine
Imo2000P3.solution_setline 445 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Set,RealProof uses:
Set.Ici,HDiv.hDiv,OfNat.ofNat,HSub.hSub10 instances, coercions and auxiliary constants left out.
- problem
Imo2000P3.imo2000_p3line 447 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Real,Iff,Membership.mem,Set, Imo2000P3.solution_set,And,LT.lt, Imo2000P3.AllRightOfProof uses:
HSub.hSub,cast,Eq.symm,Eq.trans,congrFun',congrArg,Nat.cast_one,lt_of_lt_of_le,one_lt_two,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HAdd.hAdd,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,HMul.hMul,HPow.hPow,Int.rawCast,inferInstanceand 49 more109 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.