Compfiles/Usa1980P2.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
12 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1980, Problem 2
Find the maximum possible number of three term arithmetic progressions in a monotone sequence of n distinct reals.
Imports (6)
Imported by 1 file
- def
Usa1980P2.apPairsFor a sequencea : ℕ → ℝand an indexj, the finset of pairs(i, k)withi < j < k < nsuch thata i, a j, a kforms a three-term arithmetic progression line 47 sourceSource documentation
For a sequence
a : ℕ → ℝand an indexj, the finset of pairs(i, k)withi < j < k < nsuch thata i, a j, a kforms a three-term arithmetic progression. Every three-term arithmetic progression with indices belowncorresponds to exactly one such pair, withjits middle index.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Real,Finset,ProdProof uses:
Finset.filter,Eq,HAdd.hAdd,Prod.fst,Prod.snd,HMul.hMul,OfNat.ofNat,SProd.sprod,Finset.range,Finset.Ioo11 instances, coercions and auxiliary constants left out.
noncomputable def apPairs (n : ℕ) (a : ℕ → ℝ) (j : ℕ) : Finset (ℕ × ℕ) := …
- def
Usa1980P2.apCountThe number of three-term arithmetic progressions among the firstnterms ofa, counted by their middle index line 52 sourceSource documentation
The number of three-term arithmetic progressions among the first
nterms ofa, counted by their middle index.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,RealProof uses:
Finset.sum,Finset.range,Finset.card,Prod, Usa1980P2.apPairs1 instances, coercions and auxiliary constants left out.
noncomputable def apCount (n : ℕ) (a : ℕ → ℝ) : ℕ := …
- theorem
Usa1980P2.mem_apPairsline 55 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Real,Prod,Iff,Membership.mem,Finset, Usa1980P2.apPairs,And,LT.lt,Prod.fst,Prod.snd,Eq,HAdd.hAdd,HMul.hMul,OfNat.ofNatProof uses:
Eq.mpr,id,congrFun',congrArg,Eq.trans,Finset.filter,SProd.sprod,Finset.range,Finset.Ioo,congr,Iff.intro,And.intro35 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1980P2.card_apPairs_leDocumented declaration: card_apPairs_le line 63 sourceSource documentation
A three-term progression is determined by its middle term together with any one of its other two terms, so the number of progressions with middle index
jis at mostmin j (n - 1 - j).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Real,StrictMonoOn,Set.Iio,LE.le,Finset.card,Prod, Usa1980P2.apPairs,Min.min,HSub.hSub,OfNat.ofNatProof uses:
le_min,Finset.range,Finset.card_le_card_of_injOn,Prod.fst,Membership.mem,Set,Finset,Iff.mpr,LT.lt,Finset.mem_range,And.left,And,Prod.snd,Eq,HAdd.hAdd,HMul.hMul,Eq.mp,congrArg,propext, Usa1980P2.mem_apPairs and 69 more77 instances, coercions and auxiliary constants left out.
Tactic trace: 36 steps
Open to load the checked before-and-after goal states.
theorem card_apPairs_le (n : ℕ) (a : ℕ → ℝ) (ha : StrictMonoOn a (Set.Iio n)) (j : ℕ) : (apPairs n a j).card ≤ min j (n - 1 - j) := by …Mentions: Usa1980P2.apPairs
- theorem
Usa1980P2.sum_min_stepThe per-index bounds telescope in steps of two:∑ j < n + 2, min j (n + 1 - j) = ∑ j < n, min j (n - 1 - j) + nline 98 sourceSource documentation
The per-index bounds telescope in steps of two:
∑ j < n + 2, min j (n + 1 - j) = ∑ j < n, min j (n - 1 - j) + n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.sum,Finset.range,HAdd.hAdd,OfNat.ofNat,Min.min,HSub.hSubProof uses:
Eq.mpr,id,congrArg,Finset.sum_range_succ',Finset.sum_range_succ,congrFun',Eq.trans,congr,Nat.sub_self,Nat.min_zero,add_zero,Nat.zero_min,Membership.mem,Finset,Eq.mp,LT.lt,propext,Finset.mem_range,min_add_add_right,Eq.refland 11 more36 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
theorem sum_min_step (n : ℕ) : (∑ j ∈ range (n + 2), min j (n + 1 - j)) = (∑ j ∈ range n, min j (n - 1 - j)) + n := by … - theorem
Usa1980P2.sum_min_closedClosed form of the total bound:∑ j < n, min j (n - 1 - j) = (n - 1)² / 4line 111 sourceSource documentation
Closed form of the total bound:
∑ j < n, min j (n - 1 - j) = (n - 1)² / 4.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.sum,Finset.range,Min.min,HSub.hSub,OfNat.ofNat,HDiv.hDiv,HPow.hPowProof uses:
And,HAdd.hAdd,Nat.recAux,And.intro,of_eq_true,Eq.trans,True,congr,congrArg,EmptyCollection.emptyCollection,Finset,funext,congrFun',zero_tsub,inf_of_le_right,LE.le,Finset.sum_const_zero,zero_pow,Not,Falseand 57 more66 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
theorem sum_min_closed (n : ℕ) : (∑ j ∈ range n, min j (n - 1 - j)) = (n - 1)^2 / 4 := by …
- theorem
Usa1980P2.strictMonoOn_castThe sequencea i = iis strictly increasing onSet.Iio nline 129 sourceSource documentation
The sequence
a i = iis strictly increasing onSet.Iio n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,StrictMonoOn,Real,Set.IioProof uses:
StrictMono.strictMonoOn,strictMono_nat_of_lt_succ,cast,LT.lt,HAdd.hAdd,OfNat.ofNat,Eq.symm,Nat.lt_succ_self29 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem strictMonoOn_cast (n : ℕ) : StrictMonoOn (fun i : ℕ => (i : ℝ)) (Set.Iio n) := …
- theorem
Usa1980P2.card_apPairs_castDocumented declaration: card_apPairs_cast line 135 sourceSource documentation
Equality holds in
card_apPairs_lefor the sequencea i = i: the pairs(j - 1 - d, j + 1 + d)ford < min j (n - 1 - j)are distinct elements ofapPairs n (fun i => (i : ℝ)) j.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.card,Prod, Usa1980P2.apPairs,Real,Min.min,HSub.hSub,OfNat.ofNatProof uses:
le_antisymm, Usa1980P2.card_apPairs_le, Usa1980P2.strictMonoOn_cast,LE.le,Finset.range,Finset.card_le_card_of_injOn,Prod.mk,HAdd.hAdd,Membership.mem,Set,Finset,Eq.mpr,id,congrArg,propext,Finset.mem_coe,And,LT.lt,Prod.fst,Prod.sndand 13 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 26 steps
Open to load the checked before-and-after goal states.
theorem card_apPairs_cast (n : ℕ) (j : ℕ) : (apPairs n (fun i => (i : ℝ)) j).card = min j (n - 1 - j) := by …Mentions: Usa1980P2.apPairs
- theorem
Usa1980P2.apCount_castThe bound is achieved by the sequencea i = iline 159 sourceSource documentation
The bound is achieved by the sequence
a i = i.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq, Usa1980P2.apCount,Real,HDiv.hDiv,HPow.hPow,HSub.hSub,OfNat.ofNatProof uses:
id,Eq.mpr,Finset.sum,Finset.range,Finset.card,Prod, Usa1980P2.apPairs,Min.min,congrArg,Eq.symm, Usa1980P2.sum_min_closed,Finset.sum_congr,rfl,Finset,Membership.mem, Usa1980P2.card_apPairs_cast26 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
theorem apCount_cast (n : ℕ) : apCount n (fun i : ℕ => (i : ℝ)) = (n - 1)^2 / 4 := by …
Mentions: Usa1980P2.apCount
- theorem
Usa1980P2.apCount_leThe bound holds for every strictly increasing sequence line 165 sourceSource documentation
The bound holds for every strictly increasing sequence.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Real,StrictMonoOn,Set.Iio,LE.le, Usa1980P2.apCount,HDiv.hDiv,HPow.hPow,HSub.hSub,OfNat.ofNatProof uses:
id,Eq.mpr,Finset.sum,Finset.range,Finset.card,Prod, Usa1980P2.apPairs,Min.min,Eq,congrArg,Eq.symm, Usa1980P2.sum_min_closed,Finset.sum_le_sum,Membership.mem,Finset, Usa1980P2.card_apPairs_le30 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
theorem apCount_le (n : ℕ) (a : ℕ → ℝ) (ha : StrictMonoOn a (Set.Iio n)) : apCount n a ≤ (n - 1)^2 / 4 := by …Mentions: Usa1980P2.apCount
- determine
Usa1980P2.answerline 173 sourcestandard axioms: propext what this means
Statement uses:
NatProof uses:
HDiv.hDiv,HPow.hPow,HSub.hSub,OfNat.ofNat9 instances, coercions and auxiliary constants left out.
- problem
Usa1980P2.usa1980_p2line 175 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,IsGreatest,Set.ofPred,Exists,Real,And,StrictMonoOn,Set.Iio,Eq, Usa1980P2.apCount, Usa1980P2.answerProof uses:
And.intro,Membership.mem,Set,upperBounds,Exists.intro, Usa1980P2.strictMonoOn_cast,Eq.symm,HDiv.hDiv,HPow.hPow,HSub.hSub,OfNat.ofNat, Usa1980P2.apCount_cast,LE.le, Usa1980P2.apCount_le21 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.