Compfiles/Usa2006P2.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
5 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 2006, Problem 2
For a given positive integer k find, in terms of k, the minimum value of N for which there is a set of 2k + 1 distinct positive integers that has sum greater than N but every subset of size k has sum at most N / 2.
Imports (13)
- Mathlib.Algebra.BigOperators.Intervals
- Mathlib.Algebra.BigOperators.Ring.Finset
- Mathlib.Algebra.Order.Ring.Star
- Mathlib.Data.Int.ConditionallyCompleteOrder
- Mathlib.Data.Int.Star
- Mathlib.Tactic.Linarith
- Mathlib.Tactic.Linarith.Lemmas
- Mathlib.Tactic.LinearCombination
- Mathlib.Tactic.LinearCombination.Lemmas
- Mathlib.Tactic.NormNum.Ineq
- Mathlib.Tactic.Ring.Basic
- Mathlib.Tactic.Zify
- ProblemExtraction
Imported by 1 file
- determine
Usa2006P2.solutionline 38 sourcestandard axioms: propext what this means
Statement uses:
NatProof uses:
HAdd.hAdd,HMul.hMul,OfNat.ofNat,HPow.hPow9 instances, coercions and auxiliary constants left out.
- lemma
Usa2006P2.two_mul_sum_geDocumented declaration: two_mul_sum_ge line 49 sourceSource documentation
Lower bound for the sum of a finset of natural numbers bounded below: if every element of
Jis at leasta, then the sum ofJis at least the sum of theJ.cardsmallest allowed valuesa, a+1, .... Equivalently2 * ∑ j ∈ J, j ≥ J.card * (2 * a + (J.card - 1)); we use this formulation to avoid truncated subtraction.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Membership.mem,LE.le,HAdd.hAdd,HMul.hMul,Finset.card,OfNat.ofNat,HPow.hPow,Finset.sumProof uses:
Finset.strongInductionOn,LT.lt,dite,Finset.Nonempty,Finset.max',Eq,rfl,Finset.max'_mem,Finset.erase,Finset.erase_ssubset,Finset.mem_of_mem_erase,Finset.card_erase_add_one,Finset.add_sum_erase,Finset.Ico,Finset.card_le_card,Finset.le_max',And.right,Ne,Eq.mp,Andand 98 more111 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
lemma two_mul_sum_ge (J : Finset ℕ) (a : ℕ) (hJ : ∀ j ∈ J, a ≤ j) : J.card * (2 * a) + J.card ^ 2 ≤ 2 * ∑ j ∈ J, j + J.card := by … - lemma
Usa2006P2.two_mul_sum_leDocumented declaration: two_mul_sum_le line 81 sourceSource documentation
Upper bound for the sum of a finset of natural numbers bounded above: if every element of
Jis at mostb, then the sum ofJis at most the sum of theJ.cardlargest allowed valuesb, b-1, .... Equivalently2 * ∑ j ∈ J, j ≤ J.card * (2 * b + 1 - J.card); we use this formulation to avoid truncated subtraction.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Membership.mem,LE.le,HAdd.hAdd,HMul.hMul,OfNat.ofNat,Finset.sum,HPow.hPow,Finset.cardProof uses:
Finset.strongInductionOn,LT.lt,dite,Finset.Nonempty,Finset.min',Eq,rfl,Finset.min'_mem,Finset.erase,Finset.erase_ssubset,Finset.mem_of_mem_erase,Finset.card_erase_add_one,Finset.add_sum_erase,Finset.Ioc,Finset.card_le_card,Finset.min'_le,And.right,Ne,Eq.mp,Andand 98 more111 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
lemma two_mul_sum_le (J : Finset ℕ) (b : ℕ) (hJ : ∀ j ∈ J, j ≤ b) : 2 * ∑ j ∈ J, j + J.card ^ 2 ≤ 2 * (J.card * b) + J.card := by … - lemma
Usa2006P2.two_mul_sum_Icc_oneTwice the sum `1 + 2 + line 109 sourceSource documentation
Twice the sum
1 + 2 + ... + n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,HMul.hMul,OfNat.ofNat,Finset.sum,Finset.Icc,HAdd.hAddProof uses:
Nat.recAux,Eq.mpr,EmptyCollection.emptyCollection,Finset,id,congrArg,Finset.Icc_eq_empty,Finset.sum_empty,Eq.refl,Finset.sum_Icc_succ_top,Mathlib.Tactic.LinearCombination.eq_of_eq,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,HPow.hPow,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.mul_congr,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Tactic.Ring.Common.atom_pf,rfland 18 more57 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma two_mul_sum_Icc_one (n : ℕ) : 2 * ∑ i ∈ Finset.Icc 1 n, i = n * (n + 1) := by … - problem
Usa2006P2.usa2006_p2We formalise "every subset of size k has sum at most N / 2" as2 * ∑ x ∈ t, x ≤ N, which is equivalent for natural numbers line 123 sourceSource comment
We formalise "every subset of size k has sum at most N / 2" as `2 * ∑ x ∈ t, x ≤ N`, which is equivalent for natural numbers.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,IsLeast,Set.ofPred,Exists,Finset,And,Eq,Finset.card,HAdd.hAdd,HMul.hMul,Membership.mem,Finset.sum,LE.le, Usa2006P2.solutionProof uses:
id,And.intro,Set,HPow.hPow,lowerBounds,Exists.intro,Finset.image,Finset.Icc,Eq.mpr,congrArg,Finset.card_image_of_injOn,HSub.hSub,Nat.card_Icc,Iff.mp,Finset.mem_image,Eq.mp,propext,Finset.mem_Icc,Finset.sum_image,Finset.sum_add_distriband 130 more158 instances, coercions and auxiliary constants left out.
Tactic trace: 115 steps
Open to load the checked before-and-after goal states.
problem usa2006_p2 (k : ℕ) (hk : 0 < k) : IsLeast {N : ℕ | ∃ s : Finset ℕ, s.card = 2 * k + 1 ∧ (∀ x ∈ s, 0 < x) ∧ N < ∑ x ∈ s, x ∧ ∀ t ⊆ s, t.card = k → 2 * ∑ x ∈ t, x ≤ N} (solution k) := by …Mentions: Usa2006P2.solution