sumFirst_eq_zero_of_all_false
plain-language theorem explainer
If every entry in the first m positions of a boolean stream is false, the sum of those positions equals zero. Workers on finite-window sums in the measurement layer cite this for all-false cases. The proof unfolds the sum, applies function extensionality to the indicator, and simplifies.
Claim. Let $s : ℕ → Bool$. If $∀ i ∈ {0,…,m−1}, s(i)=false$, then $∑_{i=0}^{m−1} [s(i)] = 0$, where $[true]=1$ and $[false]=0$.
background
Stream is the type Nat → Bool. sumFirst m s is defined as the sum over Fin m of the indicator that returns 1 on true and 0 on false. The Streams module treats periodic extensions and finite sums; the lemma sits inside that setting. It depends only on the local definition of sumFirst and the Stream type imported from Measurement.
proof idea
Unfold sumFirst to expose the Fin-sum of indicators. Apply funext to equate the indicator function to the zero function, using the hypothesis at each i. Finish with a single simp that reduces the sum to zero.
why it matters
The result supplies the zero-sum base case for boolean windows inside the periodic-extension machinery of the module. It supports the eight-tick octave constructions that appear later in the same file and aligns with the T7 octave structure of the Recognition framework. No downstream theorems are recorded yet.
Switch to Lean above to see the machine-checked source, dependencies, and usage graph.