Dimension-level Buckingham factorization for converting programs #
PiTheorem.den_mulScaleLaw uses independent rescaling of every unit symbol,
which requires conversion freedom or a drift-free diagnosis. Physics instead
rescales dimensions. The coherent abstraction theorem supplies this weaker
law even for converting programs, but compares denotations at V and
V.comp ψ; a fixed-valuation scaling law needs one further argument.
The instrumented evaluator consults its oracle only after checking that source and target have the same dimension. Oracles agreeing on those pairs therefore produce identical evaluations, at every fuel and without a typing hypothesis. Normalization and adequacy carry that equality to a scalar denotation with scalar inputs. Coherent rescaling preserves precisely those oracle entries.
The resulting den_pi_coherent factors arbitrary signed outputs on positive
inputs through a rational basis of the dimension matrix's kernel. Its external
unit and dimension scope is closed (j = k = 0); the program may use all term
constructors, including unit and dimension binders internally. Extending this
bridge to ungrounded external unit/dimension variables is not claimed here.
Conversion oracles that agree on same-dimension pairs produce identical instrumented evaluations, because the evaluator checks that condition before consulting either oracle. No typing assumption is needed.
Scalar denotational environments as instrumented runtime values.
Equations
- LambdaS.scalarVals [] x_2 = []
- LambdaS.scalarVals (u :: us) ρ = LambdaS.Val.scalar { mag := ρ.1, unit := u } :: LambdaS.scalarVals us ρ.2
Instances For
A first-order scalar denotation depends only on conversion factors between same-dimension units. Unit and dimension binders inside the term are allowed; the external unit/dimension scope is closed.
Coherent rescaling leaves the valuation dependence of any first-order scalar program unchanged, even when the program contains conversion.
The fixed-valuation coherent scaling law, for first-order programs that may convert and may contain internal unit/dimension polymorphism.
Exponents of a unit's dimension, in an enumerated dimension basis. The empty summand is retained to reuse the general scaling enumeration.
Equations
- LambdaS.Pi.dimensionExponents eqv u v = Sum.elim (LambdaS.dimOf (LambdaS.DCtx.nil D) u).base (LambdaS.dimOf (LambdaS.DCtx.nil D) u).vars (eqv v)
Instances For
The dimension matrix: different units of one dimension have identical
columns, unlike the stronger unit-level matrix used by den_mulScaleLaw.
Equations
- LambdaS.Pi.dimensionMatrix eqv us = Matrix.of fun (v : Fin m) (i : Fin us.length) => LambdaS.Pi.dimensionExponents eqv (us.get i) v
Instances For
The classical dimension-level scaling law for converting programs. Any parametric first-order program in closed external unit/dimension scope obeys the multiplicative law over dimensions, for a fixed valuation. The program may contain internal polymorphism and conversion.
Buckingham's reduced-arity factorization for converting programs.
The matrix is over dimensions; positive arguments and arbitrary signed output
are exactly the domain of mulScaleLaw_factorization_reduced.