Documentation

LeanPool.FormalizationOfBoundedArithmetic.V0

LeanPool.FormalizationOfBoundedArithmetic.V0 #

class V0Model (num : Type) (str : outParam Type) extends FirstOrder.Language.HasLen str num, Membership num str, BASICModel num :
Type u_1

Two-sorted V0-style models used by this development.

This is a strengthened bundled API: besides the finite V0 comprehension axioms, it includes induction, order, and algebraic laws as fields so later files can build the string-addition theory over a compact typeclass interface.

Instances
    @[implicit_reducible]
    instance V0Model.instPartialOrder {num str : Type} [M : V0Model num str] :
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance V0Model.instAddZeroClass {num str : Type} [M : V0Model num str] :
    Equations
    instance V0Model.instIsLeftCancelAdd {num str : Type} [M : V0Model num str] :
    instance V0Model.instIsRightCancelAdd {num str : Type} [M : V0Model num str] :
    @[implicit_reducible]
    instance V0Model.instAddMonoid {num str : Type} [M : V0Model num str] :
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance V0Model.instLinearOrder {num str : Type} [M : V0Model num str] :
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance V0Model.instAddCommMonoid {num str : Type} [M : V0Model num str] :
    Equations
    @[implicit_reducible]
    instance V0Model.instPartialOrder_1 {num str : Type} [M : V0Model num str] :
    Equations
    theorem V0Model.xmin_comp {num str : Type} [M : V0Model num str] (X : str) :
    theorem V0Model.ex_elt_of_len_pos {num str : Type} [M : V0Model num str] {X : str} :
    theorem V0Model.lt_succ {num str : Type} [M : V0Model num str] (x : num) :
    x < x + 1
    theorem V0Model.len_not_in {num str : Type} [M : V0Model num str] {X : str} :
    theorem V0Model.not_lt_zero {num str : Type} [M : V0Model num str] {x : num} :
    ¬x < 0
    theorem V0Model.xmin {num str : Type} [M : V0Model num str] {X : str} :
    0 < FirstOrder.Language.HasLen.len Xx < FirstOrder.Language.HasLen.len X, x X y < x, yX
    theorem V0Model.comp_xind {num str : Type} [M : V0Model num str] (X : str) (z : num) :
    ∃ (Y : str), FirstOrder.Language.HasLen.len Y z + 1 y < z + 1, y Y yX
    theorem V0Model.len_ne_zero_of_in {num str : Type} [M : V0Model num str] {x : num} {X : str} :
    theorem V0Model.xind {num str : Type} [M : V0Model num str] {X : str} {z : num} :
    0 X(∀ y < z, y Xy + 1 X)z X
    theorem V0Model.ind_of_comp {num str : Type} [M : V0Model num str] (P : numProp) :
    (∀ (y : num), ∃ (Y : str), FirstOrder.Language.HasLen.len Y y z < y, z Y P z)P 0(∀ (x : num), P xP (x + 1))∀ (x : num), P x
    theorem V0Model.ind_strengthened_v0 {num str : Type} [M : V0Model num str] (P : numProp) :
    (∀ (y : num), ∃ (Y : str), FirstOrder.Language.HasLen.len Y y z < y, z Y P z)P 0(∀ (x : num), P xP (x + 1))∀ (x : num), P x

    Named alias emphasizing that this induction theorem uses the strengthened V0Model bundle.

    @[implicit_reducible]
    instance V0Model.instIDelta0Model {num str : Type} [M : V0Model num str] :
    Equations
    class HasSucc (α : Type u_1) :
    Type u_1

    Types equipped with a successor operation.

    • succ : αα

      Successor operation.

    Instances
      def Carry {num str : Type} [V0Model num str] (i : num) (X Y : str) :

      Carry predicate for binary string addition below position i.

      Equations
      Instances For
        class V0ExtModel (num : Type) (str : outParam Type) extends Zero str, HasSucc str, Add str, V0Model num str :
        Type u_1

        Extension of V0 with string successor and string addition.

        Instances
          theorem len_empty {num str : Type} [M : V0ExtModel num str] :
          def Maj (P Q R : Prop) :

          Majority predicate on three propositions.

          Equations
          Instances For
            theorem Maj_true2 {P Q R : Prop} :
            Q → (Maj P Q R P R)
            theorem Maj_true3 {P Q R : Prop} :
            R → (Maj P Q R P Q)
            theorem carry_rec1 {num str : Type} [M : V0ExtModel num str] {X Y : str} {i : num} :
            Carry i X Yi X i YCarry (i + 1) X Y
            theorem not_lt_self {num str : Type} [M : V0ExtModel num str] (i : num) :
            ¬i < i
            theorem carry_rec2 {num str : Type} [M : V0ExtModel num str] {X Y : str} {i : num} :
            i X i YCarry (i + 1) X Y
            theorem carry_rec {num str : Type} [M : V0ExtModel num str] {X Y : str} {i : num} :
            ¬Carry 0 X Y (Carry (i + 1) X Y Maj (Carry i X Y) (i X) (i Y))
            theorem exists_of_len_lt {num str : Type} [M : V0ExtModel num str] {X Y : str} :
            theorem exists_of_len_lt' {num str : Type} [M : V0ExtModel num str] {X : str} {i : num} :
            theorem len_pos_of_exists {num str : Type} [M : V0ExtModel num str] {i : num} {X : str} :
            theorem lt_add_right_of_mem_left {num str : Type} [M : V0ExtModel num str] {X : str} {b i : num} (h : i X) :

            A position belonging to X lies below len X + b for any bound b.

            theorem lt_add_left_of_mem_right {num str : Type} [M : V0ExtModel num str] {Y : str} {a i : num} (h : i Y) :

            A position belonging to Y lies below a + len Y for any bound a.

            theorem xor3_split {P Q R : Prop} :
            Xor (Xor P Q) R P ¬Q ¬R ¬P Q ¬R ¬P ¬Q R P Q R
            theorem carry_lt_add_len {num str : Type} [M : V0ExtModel num str] {X Y : str} {i : num} :
            theorem str_eq_of_mem_iff {num str : Type} [M : V0ExtModel num str] {X Y : str} :
            (∀ (y : num), y X y Y)X = Y