Encyclopedia Algebra Algebra F2 Power Weight Zero Iff

ARTICLE 3 claims 3 theorems

Algebra F2 Power Weight Zero Iff

In the framework's algebra of on-off switches, a row of switches has zero on-positions exactly when every switch is off.

The zero-weight test

Think of a row of D switches, each either on or off. The recognition framework, a discrete record of events, models such a row as a string of truth values. The weight of a row is simply the number of switches that are on. The theorem weight_zero_iff states a fact so plain it seems almost too simple to need proof: the weight is zero if and only if the row is all off. In symbols, for any row v, hammingWeight v = 0 exactly when v = 0.

The proof is immediate from the definitions: the weight counts the positions where the row reads true, so that count is zero precisely when no position reads true. The framework's machine-checked library of formal theorems records this as a proved equivalence, not an assumption. The same module proves the companion facts that the all-off row has weight zero, that every row's weight is at most D, and that in three positions there is exactly one all-off row, three rows with one on, three with two on, and one with all three on. Those counts, 1, 3, 3, 1, are the binomial coefficients for three items, and they sum with the zero row to 2^3, the total number of rows.

The theorem matters because it anchors the counting of nonzero rows. Since the zero row is the only row with weight zero, the number of rows that are not all off is 2^D - 1. In three positions that number is 7, and the framework uses that count as a proved foundation for later claims about seven basic plot families in narrative theory. The weight-zero equivalence is the hinge: it identifies the one row that must be excluded when counting the rest.

What the theorem does not claim is just as important. It says nothing about what the switches mean, only that the all-off row is unique in having no on-positions. It does not assert that any particular narrative or physical system must use three positions; the three-position case is a special application, not a consequence of the theorem. And it does not say that weight alone determines a row: two different rows can have the same weight, as the three rows of weight one show. The theorem is a precise, narrow fact about counting, and it earns its place by being exactly that narrow.

THEOREM weight_zero_iff · IndisputableMonolith/Algebra/F2Power.lean
theorem weight_zero_iff (v : F2Power D) :
    hammingWeight v = 0 ↔ v = 0 := by
  constructor
  · intro h
    unfold hammingWeight at h
    rw [Finset.card_eq_zero] at h
    funext i
    have hi : i ∉ Finset.univ.filter (fun j => v j = true) := by
      rw [h]; exact Finset.notMem_empty _
    simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hi
    -- hi : ¬ v i = true
    cases hv : v i
    · rfl
    · exact absurd hv hi
  · intro h
    subst h
    exact hammingWeight_zero
THEOREM nonzero_card · IndisputableMonolith/Algebra/F2Power.lean
/-- The number of non-zero vectors in `F2Power D` is `2 ^ D - 1`. -/
theorem nonzero_card :
    (Finset.univ.filter (fun v : F2Power D => v ≠ 0)).card = 2 ^ D - 1 := by
  have h : (Finset.univ.filter (fun v : F2Power D => v ≠ 0)).card =
           Fintype.card (F2Power D) - 1 := by
    rw [show (Finset.univ.filter (fun v : F2Power D => v ≠ 0)) =
            Finset.univ.erase 0 from ?_, Finset.card_erase_of_mem (Finset.mem_univ _)]
    · rfl
    · ext v
      simp [Finset.mem_filter, Finset.mem_erase, Finset.mem_univ]
  rw [h, card_eq]
THEOREM card_weight_zero_three · nonzero_card_three · IndisputableMonolith/Algebra/F2Power.lean
card_weight_zero_three · IndisputableMonolith/Algebra/F2Power.lean:190
/-- The unique weight-0 element: the zero vector. -/
theorem card_weight_zero_three :
    (Finset.univ.filter (fun v : F2Power 3 => hammingWeight v = 0)).card = 1 := by
  have hsubset :
      (Finset.univ.filter (fun v : F2Power 3 => hammingWeight v = 0)) = {0} := by
    ext v
    simp [Finset.mem_filter, Finset.mem_univ, Finset.mem_singleton, weight_zero_iff]
  rw [hsubset]
  rfl
/-- At `D = 3`, the non-zero count is `7`. The seven Booker plot
    families bijection in `Aesthetics.NarrativeGeodesic` chains off
    this corollary. -/
theorem nonzero_card_three :
    (Finset.univ.filter (fun v : F2Power 3 => v ≠ 0)).card = 7 := by
  have h := @nonzero_card 3
  -- h : … = 2 ^ 3 - 1
  have h2 : (2 : ℕ) ^ 3 - 1 = 7 := by norm_num
  rw [h2] at h
  exact h

What this page does not claim

The theorem does not assign meaning to the switches; it only counts them. The theorem does not force any system to use three positions. The theorem does not say that weight uniquely identifies a row, since rows of equal weight can differ.

Verify this page

Every tagged claim above names its theorem. To check one yourself rather than trust this page, elaborate the source module with Lean 4 and audit its axiom basis:

$ lake env lean IndisputableMonolith/Algebra/F2Power.lean
expected axiom basis: [propext, Classical.choice, Quot.sound] (the Lean kernel's standard three; no RS-specific axioms)

A page whose claims cannot be reproduced this way does not ship. In production, every anchor links to the exact declaration in the public source release, and this block carries the build receipt for the page itself.

Derived articles

This page is generated by a question-recursion engine: the questions its answers raise become the next pages. The current agenda, with open targets marked red:

MACHINE LAYER · GROUNDED CLAIM TABLE · CLICK TO EXPAND