Documentation

Complexity.Logics.FirstOrder.Ordered.Radix.Arithmetic

Native arithmetic on fixed-length radix words #

The radix is a source element, but a word may represent a value much larger than the source universe. Native PLUS and TIMES check only individual digit equations. Bounded digits and zero initial and final carries make these equations exact rather than modular.

Main definitions #

Main results #

References #

noncomputable def Cslib.Logic.FO.Ordered.mulEq (L : FirstOrder.Language) {α : Type u_1} (x y z : (language L).Term α) :

Apply native TIMES to three arbitrary terms.

Instances For
    @[simp]
    noncomputable def Cslib.Logic.FO.Ordered.Radix.digits (L : FirstOrder.Language) {α : Type u_1} {d : ℕ} (B : (language L).Term α) (x : Fin d → (language L).Term α) :

    Every word digit is strictly below the radix.

    Instances For
      noncomputable def Cslib.Logic.FO.Ordered.Radix.cell (L : FirstOrder.Language) {α : Type u_1} (B a b y c z c' : (language L).Term α) :

      One exact affine digit equation, with all its scalar intermediate values checked.

      Instances For
        noncomputable def Cslib.Logic.FO.Ordered.Radix.affine (L : FirstOrder.Language) {α : Type u_1} {d : ℕ} (B b : (language L).Term α) (x y z : Fin d → (language L).Term α) :

        Multiply a word by a coefficient at most the radix and add another word, rejecting final overflow. Allowing the radix itself as coefficient also provides exact word shifts.

        Instances For
          @[simp]
          theorem Cslib.Logic.FO.Ordered.Radix.realize_digits {L : FirstOrder.Language} {n : ℕ} [Fact (2 ≤ n)] [L.Structure (Fin n)] {α : Type u_1} {d : ℕ} (B : (language L).Term α) (x : Fin d → (language L).Term α) (v : α → Fin n) :

          When the radix B is at least two and B ^ 3 fits in the universe, affine L B b x y z holds exactly when b ≤ B, the words x, y and z have digits below B, and their values satisfy b x + y = z.