Compfiles/Imo2015P6.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
15 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2015, Problem 6
The sequence $a_1, a_2, \dots$ of integers satisfies the conditions
- $1 ≤ a_j ≤ 2015$ for all $j ≥ 1$,
- $k + a_k ≠ l + a_l$ for all $1 ≤ k < l$. Prove that there exist two positive integers $b$ and $N$ for which $$\left|\sum_{j=m+1}^n (a_j-b)\right| ≤ 1007^2$$ for all integers $m,n$ such that $N ≤ m < n$.
Imported by 1 file
- def
ConditionThe conditions onain the problem line 34 sourceSource documentation
The conditions on
ain the problem. We reindexato start from 0 rather than 1;Nthen only has to be nonnegative rather than positive, and the sum in the problem statement is overIco m nrather thanIoc m n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,IntProof uses:
And,Membership.mem,Finset,Finset.Icc,OfNat.ofNat,Function.Injective,HAdd.hAdd9 instances, coercions and auxiliary constants left out.
def Condition (a : ℕ → ℤ) : Prop := …
- def
poolThe collection of ball heights in the solution line 62 sourceSource documentation
The collection of ball heights in the solution.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,Finset2 instances, coercions and auxiliary constants left out.
def pool (a : ℕ → ℤ) : ℕ → Finset ℤ | 0 => ∅ | t + 1 => (insert (a t) ((pool a t).erase 0)).map (Equiv.subRight (1 : ℤ)) variable {a : ℕ → ℤ} (ha : Condition a) {t : ℕ} section PoolMentions: Condition
- lemma
exists_add_eq_of_mem_poolline 70 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,Membership.mem,Finset, pool,Exists,And,LT.lt,Eq,HAdd.hAddProof uses:
Nat.recAux,OfNat.ofNat,False.elim,Eq.mp,False,Insert.insert,Finset.erase,HSub.hSub,Equiv,Equiv.subRight,congrArg,funext,congrFun',Equiv.subRight_apply,Finset.map,Equiv.toEmbedding,Function.Embedding,Ne,Or,propextand 4 more34 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
- lemma
pool_subset_IccThe ball heights are always within[0, 2014]line 84 sourceSource documentation
The ball heights are always within
[0, 2014].standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,LE.le,Finset, pool,Finset.Icc,OfNat.ofNatProof uses:
Nat.recAux,of_eq_true,EmptyCollection.emptyCollection,Membership.mem,HAdd.hAdd,And,Insert.insert,Finset.erase,Eq,HSub.hSub,Exists,Eq.mp,Equiv,Equiv.subRight,congrArg,funext,congrFun',Equiv.subRight_apply,Finset.map,Equiv.toEmbeddingand 13 more38 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
lemma pool_subset_Icc : pool a t ⊆ Finset.Icc 0 2014 := by …
Mentions: pool
- lemma
not_mem_pool_selfline 97 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,Not,Membership.mem,Finset, poolProof uses:
id,And,LT.lt,Eq,HAdd.hAdd,Exists,False, exists_add_eq_of_mem_pool,LT.lt.ne,And.right,Finset.Icc,OfNat.ofNat,Function.Injective15 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
card_poolThe number of balls stays unchanged if there is a ball with height 0 and increases by 1 otherwise line 104 sourceSource documentation
The number of balls stays unchanged if there is a ball with height 0 and increases by 1 otherwise.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,Eq,Finset.card, pool,HAdd.hAdd,OfNat.ofNat,ite,Membership.mem,FinsetProof uses:
Not,Finset.erase,Eq.mpr,And,Ne,id,congrArg,propext,Finset.mem_erase,Or,not_and_or,Or.inr, not_mem_pool_self,Finset.map,Equiv.toEmbedding,Equiv.subRight,Insert.insert,Nat.succ,pool.eq_2,Finset.card_mapand 14 more22 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
lemma card_pool : Finset.card (pool a (t + 1)) = Finset.card (pool a t) + if 0 ∈ pool a t then 0 else 1 := by …
Mentions: pool
- lemma
monotone_card_poolline 112 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,Monotone,Finset.card, poolProof uses:
monotone_nat_of_le_succ,Eq,HAdd.hAdd,OfNat.ofNat,ite,Membership.mem,Finset, card_pool11 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
exists_max_card_poolThere exists a point where the number of balls reaches a maximum (which follows from its monotonicity and boundedness) line 118 sourceSource documentation
There exists a point where the number of balls reaches a maximum (which follows from its monotonicity and boundedness). We take its coordinates for the problem's
bandN.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,Exists,GE.ge,Eq,Finset.card, poolProof uses:
converges_of_monotone_of_bounded, monotone_card_pool,OfNat.ofNat,Eq.mp,LE.le,Finset.Icc,congrArg,Eq.trans,Int.toNat,HSub.hSub,HAdd.hAdd,Int.card_Icc,sub_zero,Finset.card_le_card, pool_subset_Icc14 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
lemma exists_max_card_pool : ∃ b N, ∀ t ≥ N, Finset.card (pool a t) = b := …
Mentions: pool
- lemma
b_posline 130 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,GE.ge,Eq,Finset.card, pool,LT.lt,OfNat.ofNatProof uses:
Decidable.byContradiction,Not,False,LE.le,Or,le_or_gt, monotone_card_pool,Eq.mp,congrArg,propext,nonpos_iff_eq_zero,le_rfl,LT.lt.le,Eq.mpr,HAdd.hAdd,ite,Membership.mem,Finset,id,congrFun'and 11 more33 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
zero_mem_poolline 142 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,GE.ge,Eq,Finset.card, pool,Membership.mem,Finset,OfNat.ofNatProof uses:
HAdd.hAdd,ite, card_pool,id,Eq.mp,Eq.trans,congr,congrArg,congrFun',LE.le,forall_congr,implies_congr,Eq.refl,Not,False,implies_congr_ctx26 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
sum_sub_sum_eq_subThe key observation, one term of the telescoping sum for the problem's expression line 149 sourceSource documentation
The key observation, one term of the telescoping sum for the problem's expression.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,GE.ge,Eq,Finset.card, pool,HSub.hSub,Finset.sum,HAdd.hAdd,OfNat.ofNatProof uses:
id,Eq.mpr,Finset.map,Equiv.toEmbedding,Equiv.subRight,Insert.insert,Finset,Finset.erase,Function.Embedding,congrFun',congrArg,Finset.sum_map,Equiv,Finset.sum_congr,Eq.refl,Membership.mem,Equiv.subRight_apply,Not,And,Neand 13 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
lemma sum_sub_sum_eq_sub : ∑ x ∈ pool a (t + 1), x - ∑ x ∈ pool a t, x = a t - b := by …
Mentions: pool
- lemma
sum_telescopeThe telescoping sum giving the part of the problem's expression within the modulus signs line 158 sourceSource documentation
The telescoping sum giving the part of the problem's expression within the modulus signs.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,GE.ge,Eq,Finset.card, pool,LE.le,LT.lt,Finset.sum,Finset.Ico,HSub.hSubProof uses:
Nat.le_induction,Nat.succ,Eq.mpr,id,congrArg,HAdd.hAdd,OfNat.ofNat, sum_sub_sum_eq_sub,of_eq_true,Eq.trans,True,congrFun',Singleton.singleton,Finset,Finset.sum_congr,Nat.Ico_succ_singleton,Membership.mem,Eq.refl,Finset.sum_sub_distrib,congrand 11 more49 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma sum_telescope {m n : ℕ} (hm : N ≤ m) (hn : m < n) : ∑ j ∈ Finset.Ico m n, (a j - b) = ∑ x ∈ pool a n, x - ∑ x ∈ pool a m, x := by …Mentions: pool
- lemma
le_sum_poolline 167 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,GE.ge,Eq,Finset.card, pool,LE.le,Finset.sum,Finset.rangeProof uses:
Eq.mpr,HAdd.hAdd,OfNat.ofNat,eq_of_heq,LE,HEq,Eq.refl,HEq.refl,Eq.symm,Finset.sum_congr,Finset,id,congrArg,Membership.mem,zero_add,Finset.sum_range_le_sum,And.left,Iff.mp,Finset.Icc,Andand 2 more26 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
sum_pool_leline 173 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,GE.ge,Eq,Finset.card, pool,LE.le,Finset.sum,Finset.range,HSub.hSub,OfNat.ofNatProof uses:
Membership.mem,Finset, zero_mem_pool,Eq.mpr,Insert.insert,Finset.erase,id,congrArg,Eq.symm,Finset.insert_erase,HAdd.hAdd,Finset.sum_insert,Finset.notMem_erase,zero_add,eq_of_heq,LE,HEq,Eq.refl,HEq.refl,Finset.sum_congrand 10 more37 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- problem
Imo2015P6.imo2015_p6line 186 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int, Condition,Exists,And,GT.gt,OfNat.ofNat,GE.ge,LE.le,abs,Finset.sum,Finset.Ico,HSub.hSub,HPow.hPowProof uses:
Eq,Finset.card, pool, exists_max_card_pool,LT.lt, b_pos,Exists.intro,And.intro,Iff.mpr,Int.natCast_pos,Eq.mpr,id,congrArg, sum_telescope,Trans.trans,HMul.hMul,Finset.range,abs_sub_le_of_le_of_le, le_sum_pool,LE.le.transand 34 more117 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.