Exact local two-step Fibonacci recognizer
Abstract
A physical tree shape after two actual local updates has an exact decoder: it recovers the unique labelled physical predecessor, and distinguishes its unordered class.
Definition 1.1 (Two actual updates followed by label erasure).
\operatorname{Expanded}\left(U, X\right)\iff \exists V,W\quad\operatorname{Step}\left(U, V\right) \land \operatorname{Step}\left(V, W\right) \land \operatorname{sh}\left(W\right)=X
Formalization. D5/S3/Arith/FibonacciAtomic/LocalWiring/LocalTwoStepRecognizer.Expanded (✓ std3).
Source. Repository-derived.
Commentary.
An α leaf becomes β. A splitting β leaf may put its β and α children in either physical order. The old branches and their left and right physical links persist. The update relation permits every finite combination of the local orientations, independently of other births and of earlier updates; it specifies no probability law.
The labelled occurrences are finite non-associative binary trees. Label erasure preserves each physical parent-child link and its order, and the two-step relation is defined independently of the decoder.
Theorem 1.2 (Exact decoding, local exchanges, and class injection).
(D_{loc}(X)=\operatorname{some}\left(U\right) \iff \operatorname{Expanded}\left(U, X\right))\quad\land\quad(\operatorname{Grammar}\left(X\right) \iff \exists! U\quad\operatorname{Expanded}\left(U, X\right))
Proof. Machine-checked in Lean as D5/S3/Arith/FibonacciAtomic/LocalWiring/LocalTwoStepRecognizer.exact_local_two_step (✓ std3). ∎
Source. Repository-derived.
Commentary.
Let t be a leaf and C=(t,t). The grammar is generated by C, (C,t), (t,C), and the ordered pairs of recursively accepted shapes. A lone leaf rejects. A double leaf returns α; a mixed branch and leaf returns β exactly when the branch is C, and rejects when the branch is larger.
A double branch returns the corresponding ordered pair of predecessors exactly when both recursive calls return a predecessor; one failed child is enough to reject. Each recursive call is on an immediate subtree.
The two-step relation makes both directions literal: any two actual updates yield the decoder’s original labelled physical tree, and every accepted code is realized by two such updates. Only the labelled predecessor is unique, not the hidden birth orientations or the final labelled tree.
An arbitrary node-local exchange preserves rejection and, on acceptance, exchanges the decoded descendants as rooted label-preserving unordered isomorphism. For any two actual expansions the two shape classes are equal exactly when the two original labelled classes are equal. The induced map from labelled classes to shape classes is well defined for every allowed orientation and injective.