Documentation

HexTruncatedSeries.Classes

class Hex.TSeries.UnitOps (R : Type u) :

An executable partial inverse operation on a coefficient ring.

  • inv? : R → Option R

    Return a multiplicative inverse when one is available.

Instances

    Soundness and completeness of executable unit detection.

    Instances

      Inverses of the natural numbers 1 through m in R.

      • invNat : Nat → R

        A total lookup whose values are constrained on 1, ..., m.

      • invNat_eq (k : Nat) : 1 ≤ k → k ≤ m → ↑k * invNat m k = 1

        The lookup inverts every required natural number.

      Instances
        @[instance_reducible]
        def Hex.TSeries.NatInverses.mono {R : Type u} [Lean.Grind.CommRing R] {m m' : Nat} [NatInverses R m] (h : m' ≤ m) :

        Restrict a family of natural inverses to a smaller precision. This is a definition rather than an instance to avoid instance-search loops.

        Equations
        Instances For
          theorem Hex.TSeries.NatInverses.invNat_unique {R : Type u} [Lean.Grind.CommRing R] {m : Nat} (a b : NatInverses R m) (k : Nat) (hk : 1 ≤ k) (hkm : k ≤ m) :
          invNat m k = invNat m k

          Any two lawful choices of the inverse of a required natural agree.

          @[instance_reducible, instance 1100]

          No natural inverses are required at bound zero.

          Equations
          @[instance_reducible, instance 1200]

          A subtraction from zero still requests no inverses. Keeping this syntactic instance is necessary across module boundaries, where instance matching need not unfold Nat.sub before comparing the index.

          Equations
          @[instance_reducible, instance 1200]

          A self-difference still requests no inverses. This makes the precision-one spelling NatInverses R (1 - 1) resolve without relying on kernel reduction of subtraction during typeclass search.

          Equations
          @[instance_reducible, instance 1200]

          The precision-two algorithm spelling requests NatInverses R (2 - 1). Keep that syntactic form available across module boundaries rather than relying on typeclass search to reduce the subtraction to one.

          Equations
          @[instance_reducible, instance 1100]

          At bound one, the only required inverse is 1.

          Equations
          @[instance_reducible]

          Rational numbers have an executable inverse exactly away from zero.

          Equations

          Rational unit detection is sound and complete.

          @[instance_reducible]

          The only integer units are 1 and -1.

          Equations

          Integer unit detection is sound and complete.

          @[instance_reducible, instance 900]

          Rational numbers contain inverses of every positive natural number.

          Equations