Compfiles/Usa1996P2.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
9 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1996, Problem 2
Let S be a set of n positive integers. Let P be the set of all integers which are the sum of one or more distinct elements of S. Show that we can find n subsets of P whose union is P such that if a, b belong to the same subset, then a ≤ 2b.
Imported by 1 file
- def
Usa1996P2.SubsetSumsThe set of all sums of one or more distinct elements ofSline 29 sourceSource documentation
The set of all sums of one or more distinct elements of
S.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,SetProof uses:
Set.ofPred,Exists,And,LE.le,Finset.Nonempty,Eq,Finset.sum,id4 instances, coercions and auxiliary constants left out.
def SubsetSums (S : Finset ℕ) : Set ℕ := …
Mentions: S
- def
Usa1996P2.prefixSumThe sum of themsmallest elements ofS, taken in increasing order line 37 sourceSource documentation
The sum of the
msmallest elements ofS, taken in increasing order.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Finset.sum,Fin,Finset.card,Finset.filter,LT.lt,Finset.univ,OrderEmbedding,Finset.orderEmbOfFin16 instances, coercions and auxiliary constants left out.
def prefixSum (m : ℕ) : ℕ := …
- lemma
Usa1996P2.prefixSum_zeroline 40 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Eq, Usa1996P2.prefixSum,OfNat.ofNatProof uses:
Eq.mpr,Finset.sum,Fin,Finset.card,Finset.filter,LT.lt,Finset.univ,OrderEmbedding,Finset.orderEmbOfFin,id,congrArg,Usa1996P2.prefixSum.eq_1,EmptyCollection.emptyCollection,Finset.filter_false_of_mem,Membership.mem,Nat.not_lt_zero,Finset.sum_empty,Eq.refl26 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1996P2.prefixSum_succline 44 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LT.lt,Finset.card,Eq, Usa1996P2.prefixSum,HAdd.hAdd,OfNat.ofNat,OrderEmbedding,Fin,Finset.orderEmbOfFin,rfl,Fin.mkProof uses:
Finset.filter,Finset.univ,Insert.insert,Finset.ext,Eq.mpr,Iff,Membership.mem,Or,id,congr,congrArg,Eq.trans,And,True,congrFun',true_and,Iff.intro,Iff.mp,Nat.succ,Nat.lt_succ_iff_lt_or_eqand 15 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1996P2.sum_eq_sum_univline 67 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Eq,Finset.sum,id,Fin,Finset.card,Finset.univ,OrderEmbedding,Finset.orderEmbOfFin,rflProof uses:
Eq.mpr,Finset.map,RelEmbedding.toEmbedding,LE.le,Eq.rec,Eq.refl,Eq.trans,congrArg,Eq.symm,Finset.map_orderEmbOfFin_univ,Function.Embedding,Finset.sum_map25 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1996P2.prefixSum_cardline 72 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Eq, Usa1996P2.prefixSum,Finset.card,Finset.sum,idProof uses:
Fin,Finset.filter,LT.lt,Finset.univ,Finset.filter_true_of_mem,Membership.mem,Fin.isLt,Eq.mpr,OrderEmbedding,Finset.orderEmbOfFin,congrArg,Usa1996P2.prefixSum.eq_1,rfl, Usa1996P2.sum_eq_sum_univ,Eq.refl19 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1996P2.sum_eq_sum_filterThe sum over a subsetAofSreindexed by the increasing enumeration ofSline 78 sourceSource documentation
The sum over a subset
AofSreindexed by the increasing enumeration ofS.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LE.le,Eq,Finset.sum,id,Fin,Finset.card,Finset.filter,Membership.mem,OrderEmbedding,Finset.orderEmbOfFin,rfl,Finset.univProof uses:
Finset.map,RelEmbedding.toEmbedding,Finset.ext,Eq.mpr,Iff,Exists,And,Function.Embedding,congrFun',congrArg,Eq.trans,funext,True,true_and,Iff.intro,Set,Set.range,Finset.range_orderEmbOfFin,Exists.intro,And.introand 4 more43 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
lemma sum_eq_sum_filter (A : Finset ℕ) (hA : A ⊆ S) : A.sum id = ∑ i ∈ Finset.univ.filter (fun i : Fin S.card ↦ S.orderEmbOfFin rfl i ∈ A), S.orderEmbOfFin rfl i := by …Mentions: S
- lemma
Usa1996P2.prefixSum_succ_lt_two_mul_sumDocumented declaration: prefixSum_succ_lt_two_mul_sum line 103 sourceSource documentation
The key estimate: a subset sum strictly larger than the sum of the
msmallest elements must use some element with index at leastm, hence is at least them-th smallest element, and twice the sum exceeds them + 1prefix sum.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LE.le,LT.lt,Finset.card, Usa1996P2.prefixSum,Finset.sum,id,HAdd.hAdd,OfNat.ofNat,HMul.hMulProof uses:
Eq,Fin,Finset.filter,Membership.mem,OrderEmbedding,Finset.orderEmbOfFin,rfl,Finset.univ, Usa1996P2.sum_eq_sum_filter,Exists,And,Decidable.byContradiction,Not,Iff.mpr,Finset.mem_filter_univ,Eq.mp,Eq.trans,binderNameHint,forall_congr,Mathlib.Tactic.Push.not_and_eqand 11 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
lemma prefixSum_succ_lt_two_mul_sum (A : Finset ℕ) (hAS : A ⊆ S) (m : ℕ) (hm : m < S.card) (hx : prefixSum S m < A.sum id) : prefixSum S (m + 1) < 2 * A.sum id := by …Mentions: S, Usa1996P2.prefixSum
- problem
Usa1996P2.usa1996_p2line 137 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Membership.mem,LT.lt,OfNat.ofNat,Exists,Fin,Finset.card,Set,And,LE.le, Usa1996P2.SubsetSums,Eq,Set.iUnion,HMul.hMulProof uses:
Exists.intro,Set.ofPred, Usa1996P2.prefixSum,HAdd.hAdd,And.intro,Set.ext,Eq.mpr,Iff,id,congrFun',congrArg,Iff.intro,Finset.Nonempty,Finset.sum,Finset.sum_pos, Usa1996P2.prefixSum_card,Finset.sum_le_sum_of_subset,le_rfl,Nat.find,Nat.find_specand 13 more53 instances, coercions and auxiliary constants left out.
Tactic trace: 41 steps
Open to load the checked before-and-after goal states.