Documentation

Std.Do.SPred.SPred

State-indexed predicates #

This module provides a type SPred σs of predicates indexed by a list of states. This type forms the basis for the notion of assertion in Std.Do; see Std.Do.Assertion.

@[reducible, inline]
abbrev Std.Do.SPred (σs : List (Type u)) :

A predicate indexed by a list of states.

example : SPred [Nat, Bool] = (Nat → BoolULift Prop) := rfl
Equations
Instances For
    theorem Std.Do.SPred.ext_nil {P Q : SPred []} (h : P.down Q.down) :
    P = Q
    theorem Std.Do.SPred.ext_cons {σs : List (Type u)} {σ : Type u} {P Q : SPred (σ :: σs)} :
    (∀ (s : σ), P s = Q s)P = Q
    theorem Std.Do.SPred.ext_cons_iff {σs : List (Type u)} {σ : Type u} {P Q : SPred (σ :: σs)} :
    P = Q ∀ (s : σ), P s = Q s
    def Std.Do.SPred.pure {σs : List (Type u)} (P : Prop) :
    SPred σs

    A pure proposition P : Prop embedded into SPred. Prefer to use idiom bracket notation `⌜P⌝.

    Equations
    Instances For
      theorem Std.Do.SPred.pure_nil {P : Prop} :
      P = { down := P }
      theorem Std.Do.SPred.pure_cons {σs : List (Type u)} {σ : Type u} {P : Prop} :
      P = fun (x : σ) => P
      def Std.Do.SPred.entails {σs : List (Type u)} (P Q : SPred σs) :

      Entailment in SPred.

      Equations
      Instances For
        @[simp]
        theorem Std.Do.SPred.entails_nil {P Q : SPred []} :
        (P ⊢ₛ Q) = (P.downQ.down)
        theorem Std.Do.SPred.entails_cons {σs : List (Type u)} {σ : Type u} {P Q : SPred (σ :: σs)} :
        (P ⊢ₛ Q) = ∀ (s : σ), P s ⊢ₛ Q s
        theorem Std.Do.SPred.entails_cons_intro {σs : List (Type u)} {σ : Type u} {P Q : SPred (σ :: σs)} :
        (∀ (s : σ), P s ⊢ₛ Q s)P ⊢ₛ Q
        def Std.Do.SPred.bientails {σs : List (Type u)} (P Q : SPred σs) :

        Equivalence relation on SPred. Convert to Eq via bientails.to_eq.

        Equations
        Instances For
          @[simp]
          theorem Std.Do.SPred.bientails_nil {P Q : SPred []} :
          (P ⊣⊢ₛ Q) = (P.down Q.down)
          theorem Std.Do.SPred.bientails_cons {σs : List (Type u)} {σ : Type u} {P Q : SPred (σ :: σs)} :
          (P ⊣⊢ₛ Q) = ∀ (s : σ), P s ⊣⊢ₛ Q s
          theorem Std.Do.SPred.bientails_cons_intro {σs : List (Type u)} {σ : Type u} {P Q : SPred (σ :: σs)} :
          (∀ (s : σ), P s ⊣⊢ₛ Q s)P ⊣⊢ₛ Q
          def Std.Do.SPred.and {σs : List (Type u)} (P Q : SPred σs) :
          SPred σs

          Conjunction in SPred.

          Equations
          Instances For
            @[simp]
            theorem Std.Do.SPred.and_nil {P Q : SPred []} :
            spred(P Q) = { down := P.down Q.down }
            @[simp]
            theorem Std.Do.SPred.and_cons {σs : List (Type u)} {σ : Type u} {s : σ} {P Q : SPred (σ :: σs)} :
            spred(P Q) s = spred(P s Q s)
            def Std.Do.SPred.or {σs : List (Type u)} (P Q : SPred σs) :
            SPred σs

            Disjunction in SPred.

            Equations
            Instances For
              @[simp]
              theorem Std.Do.SPred.or_nil {P Q : SPred []} :
              spred(P Q) = { down := P.down Q.down }
              @[simp]
              theorem Std.Do.SPred.or_cons {σs : List (Type u)} {σ : Type u} {s : σ} {P Q : SPred (σ :: σs)} :
              spred(P Q) s = spred(P s Q s)
              def Std.Do.SPred.not {σs : List (Type u)} (P : SPred σs) :
              SPred σs

              Negation in SPred.

              Equations
              Instances For
                @[simp]
                theorem Std.Do.SPred.not_nil {P : SPred []} :
                spred(¬P) = { down := ¬P.down }
                @[simp]
                theorem Std.Do.SPred.not_cons {σs : List (Type u)} {σ : Type u} {s : σ} {P : SPred (σ :: σs)} :
                def Std.Do.SPred.imp {σs : List (Type u)} (P Q : SPred σs) :
                SPred σs

                Implication in SPred.

                Equations
                Instances For
                  @[simp]
                  theorem Std.Do.SPred.imp_nil {P Q : SPred []} :
                  spred(PQ) = { down := P.downQ.down }
                  @[simp]
                  theorem Std.Do.SPred.imp_cons {σs : List (Type u)} {σ : Type u} {s : σ} {P Q : SPred (σ :: σs)} :
                  def Std.Do.SPred.iff {σs : List (Type u)} (P Q : SPred σs) :
                  SPred σs

                  Biconditional in SPred.

                  Equations
                  Instances For
                    @[simp]
                    theorem Std.Do.SPred.iff_nil {P Q : SPred []} :
                    spred(P Q) = { down := P.down Q.down }
                    @[simp]
                    theorem Std.Do.SPred.iff_cons {σs : List (Type u)} {σ : Type u} {s : σ} {P Q : SPred (σ :: σs)} :
                    spred(P Q) s = spred(P s Q s)
                    def Std.Do.SPred.exists {α : Sort u} {σs : List (Type v)} (P : αSPred σs) :
                    SPred σs

                    Existential quantifier in SPred.

                    Equations
                    Instances For
                      @[simp]
                      theorem Std.Do.SPred.exists_nil {α : Sort u_1} {P : αSPred []} :
                      «exists» P = { down := (a : α), (P a).down }
                      @[simp]
                      theorem Std.Do.SPred.exists_cons {σs : List (Type u)} {σ : Type u} {s : σ} {α : Sort u_1} {P : αSPred (σ :: σs)} :
                      «exists» P s = «exists» fun (a : α) => P a s
                      def Std.Do.SPred.forall {α : Sort u} {σs : List (Type v)} (P : αSPred σs) :
                      SPred σs

                      Universal quantifier in SPred.

                      Equations
                      Instances For
                        @[simp]
                        theorem Std.Do.SPred.forall_nil {α : Sort u_1} {P : αSPred []} :
                        «forall» P = { down := ∀ (a : α), (P a).down }
                        @[simp]
                        theorem Std.Do.SPred.forall_cons {σs : List (Type u)} {σ : Type u} {s : σ} {α : Sort u_1} {P : αSPred (σ :: σs)} :
                        «forall» P s = «forall» fun (a : α) => P a s
                        def Std.Do.SPred.conjunction {σs : List (Type u)} (env : List (SPred σs)) :
                        SPred σs

                        Conjunction of a list of SPred.

                        Equations
                        Instances For
                          @[simp]
                          theorem Std.Do.SPred.conjunction_cons {σs : List (Type u)} {P : SPred σs} {env : List (SPred σs)} :
                          @[simp]
                          theorem Std.Do.SPred.conjunction_apply {σs : List (Type u)} {σ : Type u} {s : σ} {env : List (SPred (σ :: σs))} :
                          conjunction env s = conjunction (List.map (fun (x : SPred (σ :: σs)) => x s) env)