Compfiles/Usa1985P5.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
7 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1985, Problem 5
0 < a₁ ≤ a₂ ≤ a₃ ≤ ⋯ is an unbounded sequence of integers. Let bₙ = m if aₘ is the first member of the sequence to equal or exceed n. Given that a₁₉ = 85, what is the maximum possible value of a₁ + a₂ + ⋯ + a₁₉ + b₁ + b₂ + ⋯ + b₈₅?
Imports (5)
Imported by 1 file
- abbrev
Usa1985P5.cThe first indexi(0-based) such thatn ≤ a iline 31 sourceSource documentation
The first index
i(0-based) such thatn ≤ a i. This exists becauseais unbounded. The problem'sbₙisc a hu n + 1(the 1-based index).no axioms what this means
Statement uses:
Nat,Exists,LE.leProof uses:
Nat.find3 instances, coercions and auxiliary constants left out.
noncomputable abbrev c (a : ℕ → ℕ) (hu : ∀ n, ∃ i, n ≤ a i) (n : ℕ) : ℕ := …
- lemma
Usa1985P5.find_iffline 36 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Monotone,Exists,LE.le,Iff, Usa1985P5.cProof uses:
Iff.intro,le_trans,Nat.find,Nat.find_spec,Nat.find_le5 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1985P5.sum_indicator_left∑ j ∈ range 85, (if j < a i then 1 else 0)counts the elements ofrange (a i)whena i ≤ 85line 46 sourceSource documentation
∑ j ∈ range 85, (if j < a i then 1 else 0)counts the elements ofrange (a i)whena i ≤ 85.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,Finset.sum,Finset.range,ite,LT.ltProof uses:
Eq.mpr,Finset.card,Finset.filter,id,congrArg,Eq.symm,Finset.card_filter,Finset,Finset.ext,Iff,Membership.mem,And,congr,Eq.trans,congrFun',Iff.intro,And.right,And.intro,lt_of_lt_of_le,Finset.card_rangeand 1 more15 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
lemma sum_indicator_left {a : ℕ → ℕ} {i : ℕ} (hi : a i ≤ 85) : ∑ j ∈ Finset.range 85, (if j < a i then 1 else 0) = a i := by … - lemma
Usa1985P5.sum_indicator_right∑ i ∈ range 19, (if i < c a hu (j+1) then 1 else 0)counts the elements ofrange (c a hu (j+1))whenc a hu (j+1) ≤ 18line 59 sourceSource documentation
∑ i ∈ range 19, (if i < c a hu (j+1) then 1 else 0)counts the elements ofrange (c a hu (j+1))whenc a hu (j+1) ≤ 18.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Exists,LE.le, Usa1985P5.c,HAdd.hAdd,OfNat.ofNat,Eq,Finset.sum,Finset.range,ite,LT.ltProof uses:
Eq.mpr,Finset.card,Finset.filter,id,congrArg,Eq.symm,Finset.card_filter,Finset,Finset.ext,Iff,Membership.mem,And,congr,Eq.trans,congrFun',Iff.intro,And.right,And.intro,lt_of_lt_of_le,Finset.card_rangeand 1 more21 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
lemma sum_indicator_right {a : ℕ → ℕ} {hu : ∀ n, ∃ i, n ≤ a i} {j : ℕ} (hj : c a hu (j + 1) ≤ 18) : ∑ i ∈ Finset.range 19, (if i < c a hu (j + 1) then 1 else 0) = c a hu (j + 1) := by …Mentions: Usa1985P5.c
- lemma
Usa1985P5.sum_eqThe key identity: the sum is constant line 76 sourceSource documentation
The key identity: the sum is constant. Double-count the pairs
(i, j) ∈ range 19 × range 85: for each pair, exactly one ofj < a iandi < c a hu (j+1)holds, so the two indicator sums add up to19 * 85; the extra+ 1in eachbterm contributes another85.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Monotone,Exists,LE.le,Eq,OfNat.ofNat,HAdd.hAdd,Finset.sum,Finset.range, Usa1985P5.cProof uses:
Iff,LT.lt,Eq.mpr,Not,id,congrArg,Eq.symm,propext,Nat.not_le, Usa1985P5.find_iff,Iff.trans,Nat.lt_add_one_iff,Membership.mem,Finset,Iff.mp,Finset.mem_range,Nat.find_le,ite,Finset.sum_congr,rfland 39 more49 instances, coercions and auxiliary constants left out.
Tactic trace: 44 steps
Open to load the checked before-and-after goal states.
lemma sum_eq (a : ℕ → ℕ) (hm : Monotone a) (hu : ∀ n, ∃ i, n ≤ a i) (h19 : a 18 = 85) : ∑ i ∈ Finset.range 19, a i + ∑ j ∈ Finset.range 85, (c a hu (j + 1) + 1) = 1700 := by …Mentions: Usa1985P5.c
- determine
Usa1985P5.solutionline 136 sourceno axioms what this means
Statement uses:
NatProof uses:
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
- problem
Usa1985P5.usa1985_p5line 138 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IsGreatest,Nat,Set.ofPred,Exists,Monotone,LT.lt,OfNat.ofNat,LE.le,And,Eq,HAdd.hAdd,Finset.sum,Finset.range, Usa1985P5.c, Usa1985P5.solutionProof uses:
HSub.hSub,Nat.add_le_add_left,Nat.sub_le_sub_right,of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl,Exists.intro,And.intro,Membership.mem,Set,upperBounds,Eq.symm, Usa1985P5.sum_eq,Eq.mpr,congrArg,le_of_eq23 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.