Finite-set interval inclusion-exclusion
ProvedFinset.interval_inclusion_exclusioncombinatoricsfinite-setsinclusion-exclusion
Let be finite subsets of a type with decidable equality. Let and be rational-valued functions on finite subsets, and suppose that for every finite set ,
Then the sum of over the Boolean interval is
The formula is valid even when is not a subset of ; both sides then give the corresponding inclusion-exclusion value.
Preamble
import Mathlib open Finset attribute [local instance] Classical.propDecidable
Formal statement
namespace Finset
open Finset
theorem interval_inclusion_exclusion {α : Type*} [DecidableEq α]
(D B : Finset α) (g f : Finset α → ℚ)
(hf : ∀ A : Finset α, f A = ∑ C ∈ A.powerset, g C) :
(∑ C ∈ B.powerset.filter (fun C => D ⊆ C), g C) =
∑ S ∈ D.powerset, (-1 : ℚ) ^ S.card * f (B \ S) := by
sorry
end FinsetSource
A proved finite-sum inclusion-exclusion derivation developed in this project. It is presented as an independent specialization of Boolean-lattice inclusion-exclusion, not as a verbatim theorem from an external source.