import Gimle.Forseti.Examples.LinearCircuitModels
L1–1import Mathlib.Tactic.FinCases
L2–2import Mathlib.Tactic.IntervalCases
L3–3import Mathlib.Tactic.NormNum
L4–4import Mathlib.Tactic.Ring
L5–5The Fibonacci stream 0,1,1,2,3,… is produced by more than one linear program. We compare a two-state and a three-state program, both compiled in Gimle.Forseti.Examples.LinearCircuitModels, and prove that they produce the same output at every step.
Consider the simultaneous recurrences
(x0,x1)+=(x0+x1,x0),ox=x0, (y0,y1,y2)+=(y1,y0+y1,2y2),oy=y1. At starts (0,1) and (1,0,1), respectively, both output prefixes are 0,1,1,2,3. Observation zero reads the initial state, before any update. The extra coordinate doubles at each step and is unobserved. Output agreement does not imply bounded states or identical state representations.
The sum of the state dimensions is five. The reusable finite-dimensional criterion proves that equality of these five observations implies equality at every natural-number step. Below we first establish that prefix for the larger family (0,r) and (r,0,r), for every real r, then specialize to r=1. All semantics are exact over the reals with rational coefficients.
namespace Gimle.Forseti.Examples.LinearCircuitFibonacci
L32–32open Gimle.Asgard Gimle.Forseti Gimle.Forseti.LinearCircuit
L34–34open Gimle.Forseti.Examples.LinearCircuitModels
L36–36#print axioms fibonacci_scaled_prefix
L166–166#print axioms fibonacci_scaled_equivalent
L167–167#print axioms fibonacci_equivalent
L168–168#print axioms fibonacci_hoare
L169–169#print axioms permutation_equivalent
L170–170end Gimle.Forseti.Examples.LinearCircuitFibonacci
L172–172