Compfiles/Usa1994P5.lean

GitHub source file

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 1994, Problem 5

Let |U|, σ(U) and π(U) denote the number of elements, the sum, and the product, respectively, of a finite set U of positive integers. (If U is the empty set, |U| = 0, σ(U) = 0, π(U) = 1.) Let S be a finite set of positive integers. As usual, we define (n k) = n! / (k! (n-k)!) for 0 ≤ k ≤ n and (n k) = 0 otherwise. Prove that

∑_{U ⊆ S} (-1)^{|U|} (m - σ(U) choose |S|) = π(S)

for all integers m ≥ σ(S).

Imports (11)
Imported by 1 file
  1. def Usa1994P5.altSum The alternating sum ∑_{U ⊆ s} (-1)^{|U|} (m - σ(U)).choose k, viewed as an integer line 45 source

    Source documentation

    The alternating sum ∑_{U ⊆ s} (-1)^{|U|} (m - σ(U)).choose k, viewed as an integer.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, Int

    Proof uses: Finset.sum, Finset.powerset, HMul.hMul, HPow.hPow, Neg.neg, OfNat.ofNat, Finset.card, Nat.choose, HSub.hSub

    14 instances, coercions and auxiliary constants left out.

    def altSum (s : Finset ℕ) (k m : ℕ) : ℤ :=
    …
  2. theorem Usa1994P5.altSum_insert Splitting off the element x: summing over subsets of insert x s separates the subsets not containing x from those containing it line 50 source

    Source documentation

    Splitting off the element x: summing over subsets of insert x s separates the subsets not containing x from those containing it.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, Not, Membership.mem, Eq, Int, Usa1994P5.altSum, Insert.insert, HSub.hSub

    Proof uses: Disjoint, Finset.powerset, Finset.image, Eq.mpr, id, congrArg, propext, Finset.disjoint_left, And, Exists, False, Eq.mp, Finset.mem_image, Eq.rec, Finset.mem_insert_self, Iff.mp, LE.le, Finset.mem_powerset, Finset.erase, Finset.erase_insert and 61 more

    73 instances, coercions and auxiliary constants left out.

    Tactic trace: 22 steps

    Open to load the checked before-and-after goal states.

    theorem altSum_insert {s : Finset ℕ} {x : ℕ} (hx : x ∉ s) (k m : ℕ) :
        altSum (insert x s) k m = altSum s k m - altSum s k (m - x) := by
    …

    Mentions: Usa1994P5.altSum

  3. theorem Usa1994P5.altSum_sub_one Pascal's rule applied termwise: the forward difference of altSum s (k+1) at m equals altSum s k (m-1) line 81 source

    Source documentation

    Pascal's rule applied termwise: the forward difference of altSum s (k+1) at m equals altSum s k (m-1).

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, LT.lt, Finset.sum, Eq, Int, HSub.hSub, Usa1994P5.altSum, HAdd.hAdd, OfNat.ofNat

    Proof uses: id, Eq.mpr, Finset.powerset, HMul.hMul, HPow.hPow, Neg.neg, Finset.card, Nat.choose, congrArg, Eq.symm, Finset.sum_sub_distrib, Finset.sum_congr, rfl, Membership.mem, mul_sub, HMul, Eq.rec, Eq.refl, LE.le, Finset.sum_le_sum_of_subset and 57 more

    103 instances, coercions and auxiliary constants left out.

    Tactic trace: 16 steps

    Open to load the checked before-and-after goal states.

    theorem altSum_sub_one (s : Finset ℕ) (k m : ℕ) (h : ∑ i ∈ s, i < m) :
        altSum s (k + 1) m - altSum s (k + 1) (m - 1) = altSum s k (m - 1) := by
    …

    Mentions: h, Usa1994P5.altSum

  4. theorem Usa1994P5.telescope Telescoping the forward differences over j ∈ range x line 101 source

    Source documentation

    Telescoping the forward differences over j ∈ range x.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, Eq, Int, HSub.hSub, Usa1994P5.altSum, Finset.sum, Finset.range, OfNat.ofNat

    Proof uses: HAdd.hAdd, Finset.sum_range_sub', Eq.mpr, id, congrArg, Eq.symm, Finset.sum_congr, rfl, Membership.mem, Nat.sub_sub, Eq.refl

    19 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

    Open to load the checked before-and-after goal states.

    theorem telescope (s : Finset ℕ) (k m x : ℕ) :
        altSum s k m - altSum s k (m - x)
          = ∑ j ∈ Finset.range x, (altSum s k (m - j) - altSum s k (m - j - 1)) := by
    …

    Mentions: Usa1994P5.altSum

  5. theorem Usa1994P5.altSum_card The main identity, by induction on the finite set s line 112 source

    Source documentation

    The main identity, by induction on the finite set s.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, LE.le, Finset.sum, Eq, Int, Usa1994P5.altSum, Finset.card, Finset.prod

    Proof uses: Finset.induction_on, EmptyCollection.emptyCollection, of_eq_true, OfNat.ofNat, Eq.trans, True, congrFun', congrArg, Singleton.singleton, HMul.hMul, HPow.hPow, Neg.neg, Nat.choose, HSub.hSub, funext, Nat.choose_zero_right, Nat.cast_one, mul_one, Finset.sum_singleton, pow_zero and 26 more

    63 instances, coercions and auxiliary constants left out.

    Tactic trace: 16 steps

    Open to load the checked before-and-after goal states.

    theorem altSum_card (s : Finset ℕ) :
        ∀ m : ℕ, ∑ i ∈ s, i ≤ m → altSum s s.card m = ∏ i ∈ s, (i : ℤ) := by
    …

    Mentions: Usa1994P5.altSum

  6. problem Usa1994P5.usa1994_p5 line 132 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Finset, Nat, Membership.mem, LT.lt, OfNat.ofNat, LE.le, Finset.sum, Eq, Int, Finset.powerset, HMul.hMul, HPow.hPow, Neg.neg, Finset.card, Nat.choose, HSub.hSub, Finset.prod

    Proof uses: Eq.mpr, id, congrArg, Nat.cast_prod, Usa1994P5.altSum_card

    47 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.