AFTD Auto-Formalizing Theoretical Domains

op861_boolean_restrictions_injective

theoremverified

A Boolean function on a finite set is determined by its restrictions to the complement of a union of blocks and to each block in the indexed family.

Statement

theorem op861_boolean_restrictions_injective (β ι : Type) [Fintype β]
    [DecidableEq β] [DecidableEq ι] (J : Finset ι) (B : ι → Finset β) :
    Function.Injective (fun ω : β → Bool =>
      ((fun t : {t : β // t ∉ J.biUnion B} => ω t.1),
       (fun i : {i : ι // i ∈ J} => fun t : {t : β // t ∈ B i.1} => ω t.1)))
Source
Finite restriction injection used in op861_disjoint_boolean_windows_count.
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 2
  • op861_boolean_block_product_boundFor Boolean assignments on a finite coordinate set and any family of block predicates depending on the assignment outside all blocks, the…
  • op861_disjoint_boolean_windows_countFor a finite Boolean coordinate set, pairwise disjoint coordinate blocks, and integer offsets depending only on coordinates outside all…

The proof, explained

To show that the restriction map is injective, assume two Boolean functions f and g have identical restrictions. By function extensionality, it suffices to prove f(t) = g(t) for every element t. If t belongs to some block B(i) with i ∈ J, equality follows from the second component of the data, which specifies the restriction to each B(i). Otherwise, t lies in the complement of the union of all blocks, and equality follows from the first component.

  1. To show that f = g, it suffices to show that f(t) = g(t) for every element t ∈ β, which we divide into the cases t ∈ ⋃_{i ∈ J} B(i) and t ∉ ⋃_{i ∈ J} B(i).

    Assume f, g : β → Bool have the same restrictions, given by hypothesis h. By functional extensionality (funext), f and g are equal if they agree on every t ∈ β. We then perform a case distinction on whether t belongs to the union of blocks ⋃_{i ∈ J} B(i).

    lines 8–11

      classical
      intro f g h
      funext t
      by_cases ht : t ∈ J.biUnion B
  2. If t ∈ ⋃_{i ∈ J} B(i), then f(t) = g(t).

    Since t belongs to the union ⋃_{i ∈ J} B(i), there exists an index i ∈ J such that t ∈ B(i) by Finset.mem_biUnion.mp. Projecting the equality h onto the second component via congrArg Prod.snd shows that the families of block restrictions of f and g coincide. Evaluating this equality at i with congrFun gives equality of the restrictions to B(i), and evaluating once more at t gives f(t) = g(t).

    lines 12–15

    uses Finset.mem_biUnion.mp, congrArg, Prod.snd, congrFun

      · obtain ⟨i, hi, hti⟩ := Finset.mem_biUnion.mp ht
        have hh := congrArg Prod.snd h
        have hi' := congrFun hh ⟨i, hi⟩
        exact congrFun hi' ⟨t, hti⟩
  3. If t ∉ ⋃_{i ∈ J} B(i), then f(t) = g(t).

    When t is outside the union ⋃_{i ∈ J} B(i), it belongs to the domain of the first component. Projecting the equality h onto the first component via congrArg Prod.fst shows that the restrictions of f and g to the complement of the union are equal. Evaluating at t via congrFun yields f(t) = g(t).

    lines 16–17

    uses congrArg, Prod.fst, congrFun

      · have hh := congrArg Prod.fst h
        exact congrFun hh ⟨t, ht⟩
Finset.mem_biUnion.mp
An element belongs to a finite indexed union ⋃_{i ∈ J} B(i) only if there exists some index i ∈ J such that the element belongs to B(i).
congrArg
Applying a function to equal inputs yields equal outputs: if a₁ = a₂, then f(a₁) = f(a₂).
Prod.snd
The second projection of an ordered pair, mapping (a, b) to b.
Prod.fst
The first projection of an ordered pair, mapping (a, b) to a.
congrFun
Equal functions take equal values at any argument: if f = g, then f(a) = g(a).

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

open scoped BigOperatorstheorem op861_boolean_restrictions_injective (β ι : Type) [Fintype β]    [DecidableEq β] [DecidableEq ι] (J : Finset ι) (B : ι → Finset β) :    Function.Injective (fun ω : β → Bool =>      ((fun t : {t : β // t ∉ J.biUnion B} => ω t.1),       (fun i : {i : ι // i ∈ J} => fun t : {t : β // t ∈ B i.1} => ω t.1))) := by  classical  intro f g h  funext t  by_cases ht : t ∈ J.biUnion B  · obtain ⟨i, hi, hti⟩ := Finset.mem_biUnion.mp ht    have hh := congrArg Prod.snd h    have hi' := congrFun hh ⟨i, hi⟩    exact congrFun hi' ⟨t, hti⟩  · have hh := congrArg Prod.fst h    exact congrFun hh ⟨t, ht⟩
See it in the graphDiscuss this resultChallenge it