Fuel-free comparison of open first-order ratios #
Every scalar component of a first-order context receives its own fresh unit
variable. Tw.nf evaluates in that symbolic environment by structural recursion:
internal functions, higher-order applications, and unit binders impose no fuel
bound. Unknown function and unit-family inputs are outside this interface.
The correctness and exactness statements quantify over arbitrary positive input
drifts, not an all-ones environment. The normal form is Tw.openNF;
Tw.openNF_eq_iff is the exactness theorem, and Tw.normEq (in
LambdaS.Twist) uses it at first-order contexts.
Shapes whose unknown values have finitely many independent scalar components.
Equations
- LambdaS.Shape.scalar.firstOrder = true
- (LambdaS.Shape.vec a).firstOrder = true
- (LambdaS.Shape.mat a a_1).firstOrder = true
- (a.arrow a_1).firstOrder = false
- a.bind.firstOrder = false
Instances For
Number of independent scalar components. Higher-order inputs are excluded.
Equations
Instances For
Reconstruct a value from its scalar components.
Equations
- LambdaS.Shape.scalar.decode f = f 0
- (LambdaS.Shape.vec a).decode f = f
- (LambdaS.Shape.mat a a_1).decode f = fun (j : Fin a_1) (i : Fin a) => f (finProdFinEquiv (j, i))
- (a.arrow t).decode x_2 = LambdaS.oneSem (a.arrow t)
- t.bind.decode x_2 = LambdaS.oneSem t.bind
Instances For
Read scalar components out of a value.
Equations
- LambdaS.Shape.scalar.encode v x_3 = v
- (LambdaS.Shape.vec a).encode v i = v i
- (LambdaS.Shape.mat a a_1).encode v i = v (finProdFinEquiv.symm i).1 (finProdFinEquiv.symm i).2
- (a.arrow a_1).encode x_3 i = i.elim0
- a.bind.encode x_3 i = i.elim0
Instances For
Component reconstruction preserves every first-order value.
Reflect symbolic scalar components at their shape.
Equations
- LambdaS.Shape.scalar.reflect f = f 0
- (LambdaS.Shape.vec a).reflect f = f
- (LambdaS.Shape.mat a a_1).reflect f = fun (j : Fin a_1) (i : Fin a) => f (finProdFinEquiv (j, i))
- (s.arrow t).reflect x_2 = LambdaS.SynTw.one (s.arrow t)
- t.bind.reflect x_2 = LambdaS.SynTw.one t.bind
Instances For
Total number of independent context components.
Equations
- LambdaS.ratioCells [] = 0
- LambdaS.ratioCells (s :: Θ) = s.cells + LambdaS.ratioCells Θ
Instances For
A first-order context may contain scalars, vectors and matrices, but no functions or unit families.
Equations
Instances For
Reconstruct an environment from independent scalar components.
Equations
- One or more equations did not get rendered due to their size.
- LambdaS.decodeRatioEnv [] x_2 = PUnit.unit
Instances For
Read all scalar components of a context.
Equations
- LambdaS.encodeRatioEnv [] x_3 i = i.elim0
- LambdaS.encodeRatioEnv (s :: Θ) ρ i = Fin.addCases (s.encode ρ.1) (LambdaS.encodeRatioEnv Θ ρ.2) i
Instances For
No information is lost for first-order contexts.
Reflect a context using distinct symbolic scalar components.
Equations
- One or more equations did not get rendered due to their size.
- LambdaS.reflectRatioEnv [] x_2 = PUnit.unit
Instances For
Context reflection is related to its componentwise interpretation.
Fuel-free scalar normal form, with fresh coordinates for every input component.
Exactness for arbitrary environments requires ratioFirstOrder Θ = true.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Split the enlarged scaling into the original unit scope.
Equations
- LambdaS.ratioUnitScaling χ = { base := χ.base, vars := fun (i : Fin k) => χ.vars (Fin.castAdd (LambdaS.ratioCells Θ) i) }
Instances For
Interpret the fresh coordinates as independent positive input drifts.
Equations
- LambdaS.ratioInputEnv Θ χ = LambdaS.decodeRatioEnv Θ fun (i : Fin (LambdaS.ratioCells Θ)) => ⟨Real.exp (χ.vars (Fin.natAdd k i)), ⋯⟩
Instances For
Correctness under every assignment of original and fresh coordinates.
Extend any original scaling with the logarithms of the actual input drifts.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every first-order environment is represented by fresh coordinates.
Exactness includes all internal higher-order applications and unit binders; only the unknown input context must be first-order.