A rational function stores coprime dense numerator and denominator polynomials,
with a monic denominator. Equality compares these canonical arrays; it does not
sample values. The computational library is Mathlib-free. Its companion identifies
the representation with Mathlib's RatFunc.
normalize requires a nonzero denominator; ofFraction? checks that condition.
Arithmetic cancels common factors before multiplying. Total field division sends
division by zero to zero; div? and inv? instead reject it.
Consider initially resting stages with
y[n] = a*y[n-1] + u[n] and w[n] = b*w[n-1] + y[n].
Write X for formal delay. Their formal generating-function equations are
(1-aX)Y = U and (1-bX)W = Y. Eliminating Y gives
W = U/((1-aX)(1-bX)). This algebraic derivation does not
assume convergence of a generating series.
Cancellation identifies the rational transfer function. It does not establish
internal stability, preserve hidden state, or cover nonzero initial conditions.
The expression (X²-1)/(X-1) excludes X=1. Its rational function is
X+1, whose canonical denominator is one. The original expression's exclusion
is not stored in the rational function:
eval? returns none at a canonical pole. In contrast, Mathlib's total
RatFunc.eval returns zero there. The companion's eval?_eq_some theorem
therefore includes nonvanishing of the canonical denominator.
35.3.4. Finite fields are not sample-based equality🔗
Over the field with two elements, X²-X is nonzero but vanishes at every
field element. Meanwhile the derivative of X² vanishes:
certifyWith produces a canonical pair and Bézout witnesses.
check checks input validity, monicity, fraction equality and the Bézout identity.
Kernel replay uses check_sound; it does not rerun gcd search.
The companion exports equiv and algEquiv. Its normalize_spec identifies
both the fraction and its canonical numerator and denominator. Use the
lightweight field instance induced by the same Mathlib coefficient field;
a local priority for Field.toGrindField makes this choice explicit in
concrete-field proofs.