Documentation

Complexity.Logics.FirstOrder.Ordered.BitArithmetic

Native numeral and shift formulas #

Exact binary shifts are definable from BIT and the native addition formula. A separate no-lost-bit condition rejects overflow; matching only the visible output bits would instead define a truncated shift. Numeral formulas work even when their numeral is outside the universe: they then have no satisfying value.

Main definitions #

Main results #

References #

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

Apply the native PLUS formula to three terms.

Instances For
    noncomputable def Cslib.Logic.FO.Ordered.natEq (L : FirstOrder.Language) :
    ℕ → {α : Type u_1} → (language L).Term α → (language L).Formula α

    Equality to a fixed natural numeral, without requiring that numeral to exist.

    Instances For
      noncomputable def Cslib.Logic.FO.Ordered.scaleEq (L : FirstOrder.Language) :
      ℕ → {α : Type u_1} → (language L).Term α → (language L).Term α → (language L).Formula α

      Multiplication by a fixed literal, expanded as a fixed chain of additions.

      Instances For
        noncomputable def Cslib.Logic.FO.Ordered.powerOfTwo (L : FirstOrder.Language) {α : Type u_1} (p e : (language L).Term α) :

        Exactly one set bit, at the specified exponent.

        Instances For
          noncomputable def Cslib.Logic.FO.Ordered.highestBit (L : FirstOrder.Language) {α : Type u_1} (x h : (language L).Term α) :

          The highest set bit of a nonzero numeral.

          Instances For
            noncomputable def Cslib.Logic.FO.Ordered.shiftLeft (L : FirstOrder.Language) {α : Type u_1} (x e z : (language L).Term α) :

            Exact left shift, with every source set bit required to remain representable.

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

              natEq L k x holds exactly when x denotes k.

              @[simp]
              theorem Cslib.Logic.FO.Ordered.realize_scaleEq {L : FirstOrder.Language} {n : ℕ} [Fact (2 ≤ n)] [L.Structure (Fin n)] {α : Type u_1} (k : ℕ) (x z : (language L).Term α) (v : α → Fin n) :
              @[simp]
              theorem Cslib.Logic.FO.Ordered.realize_powerOfTwo {L : FirstOrder.Language} {n : ℕ} [Fact (2 ≤ n)] [L.Structure (Fin n)] {α : Type u_1} (p e : (language L).Term α) (v : α → Fin n) :

              powerOfTwo L p e holds exactly when p = 2 ^ e.

              @[simp]

              shiftLeft L x e z holds exactly when x * 2 ^ e = z; the product is not reduced modulo the universe size.