AFTD Auto-Formalizing Theoretical Domains

op1525_lower_incidence_descends

theoremverified

If an integer function on finite subsets is supported on k-element sets and its sum over supersets is zero at every (k−1)-element set, then the same sum vanishes at every set of cardinality less than k.

Statement

theorem op1525_lower_incidence_descends {V : Type} [DecidableEq V] [Fintype V]
    (f : Finset V → ℤ) (k : ℕ)
    (hsupport : ∀ T, f T ≠ 0 → T.card = k)
    (htop : ∀ R : Finset V, R.card + 1 = k →
      (∑ T ∈ (Finset.univ : Finset V).powerset, if R ⊆ T then f T else 0) = 0) :
    ∀ R : Finset V, R.card < k →
      (∑ T ∈ (Finset.univ : Finset V).powerset, if R ⊆ T then f T else 0) = 0
Source
Incidence-count helper for OP-1525 and arXiv:2611.13901, Remark 4.11.
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

Let H(R) = ∑_{R ⊆ T} f(T) be the superset sum of f. By interchanging summation in ∑_{x ∉ R} H(R ∪ {x}), each k-element superset T ⊇ R is counted |T \ R| = k - |R| times, yielding the identity ∑_{x ∉ R} H(R ∪ {x}) = (k - |R|) H(R). Because k - |R| > 0 when |R| < k, this identity ensures that H(R) = 0 whenever H vanishes on all one-element extensions of R. The theorem then follows by strong induction on the deficit k - |R|, descending from the given hypothesis on sets of size k - 1.

  1. Define the superset sum H(R) = ∑_{R ⊆ T} f(T).

    We enable classical reasoning and introduce the abbreviation H(R) for the sum of f(T) over all subsets T ⊆ V containing R.

    lines 8–10

      classical
      let H : Finset V → ℤ := fun R =>
        ∑ T ∈ (Finset.univ : Finset V).powerset, if R ⊆ T then f T else 0
  2. Assuming |R| < k and H(R ∪ {x}) = 0 for all x ∉ R, the sum ∑_{x ∈ V \ R} H(R ∪ {x}) vanishes.

    To prove the downward step lemma hstep, we assume that H vanishes on every one-element extension R ∪ {x} for x ∉ R. Every summand in the sum over x ∈ V \ R is therefore zero, so the sum vanishes by Finset.sum_eq_zero.

    lines 11–17

    uses Finset.sum_eq_zero

      have hstep (R : Finset V) (hlt : R.card < k)
          (hnext : ∀ x, x ∉ R → H (insert x R) = 0) : H R = 0 := by
        have hz : (∑ x ∈ (Finset.univ \ R), H (insert x R)) = 0 := by
          apply Finset.sum_eq_zero
          intro x hx
          apply hnext x
          simpa using hx
  3. For each set T, the sum over x ∈ V \ R of the indicator that R ∪ {x} ⊆ T, weighted by f(T), equals (k - |R|) f(T) if R ⊆ T and 0 otherwise.

    We evaluate the inner sum for a fixed set T by case analysis on whether R ⊆ T. If R is not a subset of T, no element x can satisfy R ∪ {x} ⊆ T by Finset.mem_insert_of_mem, so the sum is zero. If R ⊆ T, the condition R ∪ {x} ⊆ T simplifies via Finset.insert_subset_iff (with and_true and if_true) to x ∈ T. If f(T) = 0, both sides vanish. If f(T) ≠ 0, then |T| = k by the support hypothesis hsupport. The elements x ∈ V \ R that belong to T form the set difference T \ R. Summing the constant f(T) over T \ R using Finset.sum_filter and Finset.sum_const yields |T \ R| f(T), which equals (k - |R|) f(T) by Finset.card_sdiff_of_subset.

    lines 18–36

    uses Finset.insert_subset_iff, and_true, if_true, Finset.sum_filter, Finset.sum_const, Finset.card_sdiff_of_subset, Finset.mem_insert_of_mem

        have hcount (T : Finset V) :
            (∑ x ∈ (Finset.univ \ R), if insert x R ⊆ T then f T else 0) =
              if R ⊆ T then ((k - R.card : ℕ) : ℤ) * f T else 0 := by
          by_cases hRT : R ⊆ T
          · by_cases hf : f T = 0
            · simp [hf]
            · have hcard := hsupport T hf
              have heq : (Finset.univ \ R).filter (fun x => x ∈ T) = T \ R := by
                ext x
                simp
                tauto
              simp only [Finset.insert_subset_iff, hRT, and_true, if_true]
              rw [← Finset.sum_filter, heq, Finset.sum_const,
                Finset.card_sdiff_of_subset hRT, hcard]
              simp
          · have hnone : ∀ x, ¬ insert x R ⊆ T := by
              intro x h
              exact hRT (fun y hy => h (Finset.mem_insert_of_mem hy))
            simp [hRT, hnone]
  4. The sum ∑_{x ∈ V \ R} H(R ∪ {x}) equals (k - |R|) H(R).

    Unfolding H, the sum is a double summation over x ∈ V \ R and T ⊆ V. Interchanging the order of summation using Finset.sum_comm and applying the fiber-counting lemma hcount reduces the expression to ∑_{T ⊇ R} (k - |R|) f(T). Factoring out (k - |R|) via Finset.mul_sum and matching summands with Finset.sum_congr gives (k - |R|) H(R).

    lines 37–45

    uses Finset.sum_comm, Finset.mul_sum, Finset.sum_congr

        have hidentity : (∑ x ∈ (Finset.univ \ R), H (insert x R)) =
            ((k - R.card : ℕ) : ℤ) * H R := by
          dsimp [H]
          rw [Finset.sum_comm]
          simp_rw [hcount]
          rw [Finset.mul_sum]
          apply Finset.sum_congr rfl
          intro T _
          split_ifs <;> simp
  5. If |R| < k and H(R ∪ {x}) = 0 for all x ∉ R, then H(R) = 0.

    Substituting the identity hidentity into the vanishing sum hz yields (k - |R|) H(R) = 0. Since |R| < k, the integer scalar k - |R| is strictly positive and hence non-zero. By mul_eq_zero.mp, one factor must be zero, so H(R) = 0, completing the proof of hstep.

    lines 46–50

    uses mul_eq_zero.mp

        rw [hidentity] at hz
        have hn : ((k - R.card : ℕ) : ℤ) ≠ 0 := by
          have hnNat : k - R.card ≠ 0 := by omega
          exact_mod_cast hnNat
        exact (mul_eq_zero.mp hz).resolve_left hn
  6. For any deficit d ∈ ℕ and any set R with |R| < k and k - |R| = d, H(R) = 0.

    We prove this by strong induction on the deficit d = k - |R| using Nat.strong_induction_on. When |R| + 1 = k, the claim holds directly by hypothesis htop. Otherwise, |R| + 1 < k, so we apply the downward step hstep: for each x ∉ R, the set R ∪ {x} has cardinality |R| + 1 by Finset.card_insert_of_notMem, which is strictly less than k, and its deficit k - (|R| + 1) is strictly less than d. By the induction hypothesis, H(R ∪ {x}) = 0, so hstep implies H(R) = 0.

    lines 51–62

    uses Nat.strong_induction_on, Finset.card_insert_of_notMem

      have hall : ∀ d : ℕ, ∀ R : Finset V, R.card < k → k - R.card = d → H R = 0 := by
        intro d
        induction d using Nat.strong_induction_on with
        | h d ih =>
          intro R hlt hd
          by_cases heq : R.card + 1 = k
          · exact htop R heq
          · apply hstep R hlt
            intro x hx
            have hc : (insert x R).card = R.card + 1 := Finset.card_insert_of_notMem hx
            have hlt' : (insert x R).card < k := by omega
            apply ih (k - (insert x R).card) (by omega) (insert x R) hlt' rfl
  7. For every set R with |R| < k, the superset sum H(R) vanishes.

    Given any set R with |R| < k, setting d = k - |R| and applying the inductive result hall gives H(R) = 0, which completes the proof.

    lines 63–64

      intro R hR
      exact hall (k - R.card) R hR rfl
Finset.sum_eq_zero
A finite sum is zero if every term in the sum is zero.
Finset.insert_subset_iff
A set with an element inserted is a subset of T if and only if the inserted element belongs to T and the original set is a subset of T.
and_true
The conjunction of a proposition with True is equivalent to the proposition itself.
if_true
An if-then-else expression whose condition is True evaluates to the then-branch.
Finset.sum_filter
Summing over the elements of a finite set that satisfy a predicate equals summing the if-then-else indicator of the predicate over the entire set.
Finset.sum_const
Summing a constant value over a finite set equals the cardinality of the set times the constant.
Finset.card_sdiff_of_subset
The cardinality of the set difference T \ R when R ⊆ T equals |T| - |R|.
Finset.mem_insert_of_mem
An element of a set remains an element when another element is inserted into the set.
Finset.sum_comm
The order of summation in a double finite sum can be interchanged.
Finset.mul_sum
Multiplication distributes over a finite sum from the left.
Finset.sum_congr
Two finite sums over the same set are equal if their terms are equal at every element.
mul_eq_zero.mp
If the product of two numbers is zero, then at least one of the factors is zero.
Nat.strong_induction_on
The principle of complete (strong) induction on natural numbers: if a property holds for n whenever it holds for all m < n, then it holds for all n.
Finset.card_insert_of_notMem
Inserting an element not already in a finite set increases the cardinality of the set by 1.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem op1525_lower_incidence_descends {V : Type} [DecidableEq V] [Fintype V]    (f : Finset V → ℤ) (k : ℕ)    (hsupport : ∀ T, f T ≠ 0 → T.card = k)    (htop : ∀ R : Finset V, R.card + 1 = k →      (∑ T ∈ (Finset.univ : Finset V).powerset, if R ⊆ T then f T else 0) = 0) :    ∀ R : Finset V, R.card < k →      (∑ T ∈ (Finset.univ : Finset V).powerset, if R ⊆ T then f T else 0) = 0 := by  classical  let H : Finset V → ℤ := fun R =>    ∑ T ∈ (Finset.univ : Finset V).powerset, if R ⊆ T then f T else 0  have hstep (R : Finset V) (hlt : R.card < k)      (hnext : ∀ x, x ∉ R → H (insert x R) = 0) : H R = 0 := by    have hz : (∑ x ∈ (Finset.univ \ R), H (insert x R)) = 0 := by      apply Finset.sum_eq_zero      intro x hx      apply hnext x      simpa using hx    have hcount (T : Finset V) :        (∑ x ∈ (Finset.univ \ R), if insert x R ⊆ T then f T else 0) =          if R ⊆ T then ((k - R.card : ℕ) : ℤ) * f T else 0 := by      by_cases hRT : R ⊆ T      · by_cases hf : f T = 0        · simp [hf]        · have hcard := hsupport T hf          have heq : (Finset.univ \ R).filter (fun x => x ∈ T) = T \ R := by            ext x            simp            tauto          simp only [Finset.insert_subset_iff, hRT, and_true, if_true]          rw [← Finset.sum_filter, heq, Finset.sum_const,            Finset.card_sdiff_of_subset hRT, hcard]          simp      · have hnone : ∀ x, ¬ insert x R ⊆ T := by          intro x h          exact hRT (fun y hy => h (Finset.mem_insert_of_mem hy))        simp [hRT, hnone]    have hidentity : (∑ x ∈ (Finset.univ \ R), H (insert x R)) =        ((k - R.card : ℕ) : ℤ) * H R := by      dsimp [H]      rw [Finset.sum_comm]      simp_rw [hcount]      rw [Finset.mul_sum]      apply Finset.sum_congr rfl      intro T _      split_ifs <;> simp    rw [hidentity] at hz    have hn : ((k - R.card : ℕ) : ℤ) ≠ 0 := by      have hnNat : k - R.card ≠ 0 := by omega      exact_mod_cast hnNat    exact (mul_eq_zero.mp hz).resolve_left hn  have hall : ∀ d : ℕ, ∀ R : Finset V, R.card < k → k - R.card = d → H R = 0 := by    intro d    induction d using Nat.strong_induction_on with    | h d ih =>      intro R hlt hd      by_cases heq : R.card + 1 = k      · exact htop R heq      · apply hstep R hlt        intro x hx        have hc : (insert x R).card = R.card + 1 := Finset.card_insert_of_notMem hx        have hlt' : (insert x R).card < k := by omega        apply ih (k - (insert x R).card) (by omega) (insert x R) hlt' rfl  intro R hR  exact hall (k - R.card) R hR rfl
See it in the graphDiscuss this resultChallenge it