Compfiles/Usa1992P3.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
6 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1992, Problem 3
A set of 11 distinct positive integers has the property that we can find a subset with sum n for any n between 1 and 1500 inclusive. What is the smallest possible value for the second largest element?
Imports (7)
Imported by 1 file
- lemma
Usa1992P3.monotone_of_consec_ltIf the valuesa 0, …, a 10are strictly increasing, thenais monotone on the interval[0, 10]line 37 sourceSource documentation
If the values
a 0, …, a 10are strictly increasing, thenais monotone on the interval[0, 10].standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,HAdd.hAdd,LE.leProof uses:
Nat.recAux,le_rfl,Eq.mpr,id,Eq,congrArg,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,HMul.hMul,HPow.hPow,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Tactic.Ring.Common.add_pf_add_gt,Mathlib.Tactic.Ring.Common.add_pf_add_zero,Mathlib.Tactic.Ring.Common.add_pf_add_ltand 5 more34 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
lemma monotone_of_consec_lt (a : ℕ → ℕ) (h : ∀ i, i < 10 → a i < a (i + 1)) {i j : ℕ} (hij : i ≤ j) (hj : j ≤ 10) : a i ≤ a j := by …Mentions: h
- lemma
Usa1992P3.gapThe key gap lemma: writings jfor the sum of thejsmallest elements, ifs j < 1500then the next element satisfiesa j ≤ s j + 1line 59 sourceSource documentation
The key gap lemma: writing
s jfor the sum of thejsmallest elements, ifs j < 1500then the next element satisfiesa j ≤ s j + 1. Indeed,s j + 1 ≤ 1500must occur as a subset sum, and any subset with that sum must contain somea iwithi ≥ j, soa j ≤ a i ≤ s j + 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Exists,Finset,And,Finset.range,Eq,Finset.sum,LT.lt,HAdd.hAddProof uses:
Decidable.byContradiction,Not,Membership.mem,Iff.mp,Finset.mem_range,Eq.mp,Finset.single_le_sum,Nat.zero_le,Iff.mpr,Finset.sum_le_sum_of_subset38 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
lemma gap (a : ℕ → ℕ) (hsub : ∀ n : ℕ, 1 ≤ n → n ≤ 1500 → ∃ t : Finset ℕ, t ⊆ Finset.range 11 ∧ ∑ i ∈ t, a i = n) (hmono : ∀ {i j : ℕ}, i ≤ j → j ≤ 10 → a i ≤ a j) {j : ℕ} (_hj : j ≤ 10) (hs : ∑ i ∈ Finset.range j, a i < 1500) : a j ≤ ∑ i ∈ Finset.range j, a i + 1 := by … - lemma
Usa1992P3.pow_boundInduction using the gap lemma: the sum of theksmallest elements is at most2 ^ k - 1, for everyk ≤ 10line 90 sourceSource documentation
Induction using the gap lemma: the sum of the
ksmallest elements is at most2 ^ k - 1, for everyk ≤ 10.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Exists,Finset,And,Finset.range,Eq,Finset.sum,HSub.hSub,HPow.hPowProof uses:
Nat.recAux,of_eq_true,Eq.trans,True,congrArg,congrFun',pow_zero,tsub_self,HAdd.hAdd,pow_le_pow_right',Mathlib.Meta.NormNum.isNat_le_true,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool,Bool.true,LT.lt, Usa1992P3.gap,Eq.mpr,id,Finset.sum_range_succand 5 more64 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
lemma pow_bound (a : ℕ → ℕ) (hsub : ∀ n : ℕ, 1 ≤ n → n ≤ 1500 → ∃ t : Finset ℕ, t ⊆ Finset.range 11 ∧ ∑ i ∈ t, a i = n) (hmono : ∀ {i j : ℕ}, i ≤ j → j ≤ 10 → a i ≤ a j) : ∀ k : ℕ, k ≤ 10 → ∑ i ∈ Finset.range k, a i ≤ 2 ^ k - 1 := by … - def
Usa1992P3.GoodDocumented declaration: Good line 116 sourceSource documentation
Formalization of "a set of 11 distinct positive integers such that every integer between 1 and 1500 is the sum of a subset", with the elements listed in increasing order as
a 0 < a 1 < … < a 10.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
And,LT.lt,OfNat.ofNat,HAdd.hAdd,LE.le,Exists,Finset,Finset.range,Eq,Finset.sum9 instances, coercions and auxiliary constants left out.
def Good (a : ℕ → ℕ) : Prop := …
- determine
Usa1992P3.answerThe answer to the problem line 122 sourceSource documentation
The answer to the problem.
no axioms what this means
Statement uses:
NatProof uses:
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
determine answer : ℕ := 248
- problem
Usa1992P3.usa1992_p3line 124 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IsLeast,Nat,Set.ofPred,Exists,And, Usa1992P3.Good,Eq,OfNat.ofNat, Usa1992P3.answerProof uses:
And.intro,Membership.mem,Set,lowerBounds,Exists.intro,List.getD,List.cons,List.nil,LT.lt,HAdd.hAdd,LE.le,Finset,Finset.range,Finset.sum,of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refland 61 more81 instances, coercions and auxiliary constants left out.
Tactic trace: 116 steps
Open to load the checked before-and-after goal states.