Reference · Signed rationals
rainbow.math.rational.signed.reciprocal
The signed-rational reciprocal operation and its self-inverse law -- the missing field operation. This completes the signed rationals as a field (up to ~) and is the gate for all signed division, including the limit-quotient law. signed/reciprocal x := x * (1 / (x*x)) [sign-free: 1/x = x/x^2] signed/multiply-reciprocal-self : 1 <= numerator (magnitude (x*x)) -> x * (reciprocal x) ~ one The definition is sign-free BY CONSTRUCTION: instead of a signum case-split, it uses 1/x = x/x^2. Since x*x is always nonnegative (signed/square-nonnegative), its magnitude is a genuine nnrat and admits the make(succ p, q)-form reciprocal, so no reciprocal- respects lemma is needed. The nonzero hypothesis is `1 <= numerator (magnitude (x*x))` (equivalently x !~ 0): exactly the positive-numerator shape nnrat divide-self-positive and make-succ-of-positive-numerator consume. Proof of self-inverse: x*(x*R) ~ (x*x)*R [multiply-associative] ~ from-nnrat D * R [x*x ~ from-nnrat D, from-nnrat-magnitude] ~ from-nnrat (D * recip mmag) [from-nnrat-multiply] ~ from-nnrat one ~ one [D ~ mmag then divide-self-positive] where D = magnitude (x*x), mmag = make (succ (pred (num D))) (den-pred D), R = from-nnrat (recip mmag). Axiom-free; additive; does not touch the LP checker.
signed/reciprocal
signed/reciprocal : (x₁ : ℚ) → ℚ
ℚ = signed/SignedRational
signed/multiply-reciprocal-self
signed/multiply-reciprocal-self : (x : ℚ) (h : 1 ≤ nnrat/numerator (signed/magnitude (x · x))) → x · signed/reciprocal x = 1
1 = signed/one= = signed/equivalent: equality of rational values· = signed/multiplyℚ = signed/SignedRational≤ = nat/at-most