Main derivation
S01 · implies
Before
Q\times\Sigma\text{ has four pairs}After
\begin{array}{c|cc}\delta&0&1\\\hline E&E&O\\O&O&E\end{array}Conditions: none
Rule: calc · Uses: G1
Leaf basis: calc
All four cells have one valid output, so the DFA can read every finite word.
S02 · implies
Before
c(w)=\#\{i:w_i=1\}After
I(w):\ \delta^*(E,w)=E\iff c(w)\equiv0\pmod2
Conditions: none
Rule: calc · Uses: G1, S01
Leaf basis: calc
State the universal target invariant: the state records parity of the count of 1s in the prefix.
S03 · induction_base
Before
w=\varepsilon
After
c(\varepsilon)=0,\quad\delta^*(E,\varepsilon)=E\Rightarrow I(\varepsilon)
Conditions: none
Rule: calc · Uses: G1, S02
Leaf basis: calc
Base case: the empty word contains zero 1s, an even count, and with no input consumed the automaton remains in state E.
S04 · induction_step
Before
I(w),\quad w'=w0
After
c(w0)=c(w),\quad\delta(E,0)=E,\ \delta(O,0)=O\Rightarrow I(w0)
Conditions: the induction hypothesis I(w) holds
Rule: calc · Uses: G1, S01, S02
Leaf basis: calc
Appending 0 preserves both count and state, covering either prior parity.
S05 · induction_step
Before
I(w),\quad w'=w1
After
c(w1)=c(w)+1,\quad E\xrightarrow{1}O,\ O\xrightarrow{1}E\Rightarrow I(w1)Conditions: the induction hypothesis I(w) holds
Rule: calc · Uses: G1, S01, S02
Leaf basis: calc
Appending 1 flips both parity and state, matching both cases.
S06 · implies
Before
I(\varepsilon),\quad I(w)\Rightarrow I(w0),I(w1)
After
\forall w\in\{0,1\}^*:\ I(w)Conditions: none
Rule: calc · Uses: G1, S03, S04, S05
Leaf basis: calc
Every finite word is formed from epsilon by appending 0 or 1, so induction proves the whole-language invariant.
S07 · implies
Before
F=\{E\},\quad\forall w:\ I(w)After
w\text{ accepted}\iff w\in L\Rightarrow L\text{ regular}Conditions: none
Rule: mko_definition · Uses: G1, S01, S06
Leaf basis: mko_definition
The complete DFA accepts exactly words with even 1-count, a universal recognition certificate for L.
S08 · implies
Before
w=1011,\quad v=1010
After
c(w)=3\Rightarrow w\notin L;\quad c(v)=2\Rightarrow v\in L
Conditions: none
Rule: calc · Uses: G1, S06, S07
Leaf basis: calc
Two examples illustrate the proven invariant without replacing the proof.