Documentation

LeanPool.PDL.Syntax

Syntax (Section 2.1) #

inductive PDL.Formula :

PDL formulas, mutually defined with programs to support tests and boxes.

Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    def PDL.instDecidableEqFormula.decEq_1 (x✝ x✝¹ : Formula) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      def PDL.instDecidableEqProgram.decEq_2 (x✝ x✝¹ : Program) :
      Decidable (x✝ = x✝¹)
      Equations
      Instances For
        def PDL.instDecidableEqFormula.decEq_2 (x✝ x✝¹ : Program) :
        Decidable (x✝ = x✝¹)
        Equations
        Instances For
          def PDL.instDecidableEqProgram.decEq_1 (x✝ x✝¹ : Formula) :
          Decidable (x✝ = x✝¹)
          Equations
          Instances For
            inductive PDL.Program :

            PDL programs with atomic actions, composition, choice, iteration, and tests.

            Instances For

              Abbreviations and Notation #

              Disjunction encoded using conjunction and negation.

              Equations
              Instances For

                □(αs,φ)

                Equations
                Instances For

                  Sequential composition of a list of programs, with a true test as the empty sequence.

                  Equations
                  Instances For

                    An atomic proposition with the given natural-number index.

                    Equations
                    Instances For

                      An atomic program with the given natural-number index.

                      Equations
                      Instances For

                        Formula negation.

                        Equations
                        Instances For
                          @[instance_reducible]
                          Equations
                          @[instance_reducible]
                          Equations

                          Formula conjunction.

                          Equations
                          Instances For

                            Formula disjunction.

                            Equations
                            Instances For

                              Material implication between formulas.

                              Equations
                              Instances For

                                Material equivalence between formulas.

                                Equations
                                Instances For

                                  The box modality of a program.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    Iterated box modalities for a list of programs.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Sequential composition of programs.

                                      Equations
                                      Instances For

                                        Nondeterministic choice between programs.

                                        Equations
                                        Instances For

                                          Kleene iteration of a program.

                                          Equations
                                          Instances For

                                            The test program associated with a formula.

                                            Equations
                                            Instances For

                                              Union of a list of programs. The empty union is ?'⊥, a program that cannot be executed, so that [(⋃ ∅)*]φ is equivalent to φ.

                                              Equations
                                              Instances For

                                                A basic formula is of the form ¬⊥, p, ¬p, [a]_ or ¬[a]_. Note: in the article also ⊥ is basic, but not here because we want to apply OneSidedLocalRule.bot to it.

                                                Equations
                                                Instances For

                                                  Whether a program is an atomic action.

                                                  Equations
                                                  Instances For
                                                    theorem PDL.Program.isAtomic_iff {α : Program} :
                                                    α.isAtomic ↔ ∃ (a : ℕ), α = atom_prog a

                                                    Whether a program has an outer Kleene-star constructor.

                                                    Equations
                                                    Instances For
                                                      @[instance_reducible]
                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      theorem PDL.Program.isStar_iff {α : Program} :
                                                      α.isStar ↔ ∃ (β : Program), α = β.star

                                                      Tools for Box Formulas #

                                                      @[simp]
                                                      theorem PDL.Formula.boxes_nil {φ : Formula} :
                                                      boxes [] φ = φ
                                                      @[simp]
                                                      theorem PDL.Formula.boxes_cons {β : Program} {δ : List Program} {φ : Formula} :
                                                      boxes (β :: δ) φ = box β (boxes δ φ)
                                                      @[simp]
                                                      theorem PDL.Formula.boxes_injective {αs : List Program} {φ ψ : Formula} :
                                                      boxes αs φ = boxes αs ψ ↔ φ = ψ
                                                      theorem PDL.boxes_last {δ : List Program} {α : Program} {φ : Formula} :

                                                      Separate a formula's leading boxes from its remaining formula.

                                                      Equations
                                                      Instances For
                                                        theorem PDL.def_of_boxesOf_def {φ : Formula} {γ : List Program} {ψ : Formula} (h : boxesOf φ = (γ, ψ)) :
                                                        φ = Formula.boxes γ ψ

                                                        Whether a formula has an outer box constructor.

                                                        Equations
                                                        Instances For
                                                          theorem PDL.boxesOf_def_of_def_of_nonBox {φ : Formula} {γ : List Program} {ψ : Formula} (h : φ = Formula.boxes γ ψ) (nonBox : ¬ψ.isBox) :
                                                          boxesOf φ = (γ, ψ)
                                                          theorem PDL.nonBox_of_boxesOf_def {φ : Formula} {L : List Program} {ψ : Formula} (bdef : boxesOf φ = (L, ψ)) :
                                                          theorem PDL.boxesOf_nonBox {φ : Formula} (notBox : ¬φ.isBox) :
                                                          theorem PDL.defs_of_boxesOf_last_of_nonBox {φ : Formula} (notBox : ¬φ.isBox) (δs : List Program) (α : Program) :
                                                          boxesOf (Formula.boxes δs (Formula.box α φ)) = (δs ++ [α], φ)

                                                          If φ is not a box then we know the result of boxesOf (⌈⌈δs⌉⌉⌈α⌉φ). A more general version without α should also hold.

                                                          theorem PDL.Formula.boxes_cons_neq_self (φ : Formula) (β : Program) (δ : List Program) :
                                                          box β (boxes δ φ) ≠ φ

                                                          Loaded Formulas #

                                                          Loaded formulas consist of a non-empty sequence of loading boxes, and a normal formula. For loading boxes we write ⌊α⌋ instead of ⌈α⌉.

                                                          inductive PDL.AnyFormula :

                                                          An ordinary formula or a formula with a distinguished loaded modal path.

                                                          Instances For
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                A box whose continuation may itself carry a loaded path.

                                                                Instances For

                                                                  Negation of an ordinary or loaded formula.

                                                                  Instances For

                                                                    Load a nonempty modal sequence given its prefix and final program.

                                                                    Equations
                                                                    Instances For
                                                                      @[simp]
                                                                      theorem PDL.loadMulti_cons {β : Program} {δ : List Program} {α : Program} {φ : Formula} :

                                                                      Prepend a list of loaded boxes to a loaded continuation.

                                                                      Equations
                                                                      Instances For
                                                                        @[simp]

                                                                        Erase loading annotations to obtain an ordinary formula.

                                                                        Equations
                                                                        Instances For
                                                                          @[simp]
                                                                          theorem PDL.unload_loadMulti {δ : List Program} {α : Program} {φ : Formula} :

                                                                          A negated loaded formula.

                                                                          Instances For
                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For

                                                                              A loaded box modality.

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For

                                                                                Iterated loaded boxes for a list of programs.

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For

                                                                                  Negation of a loaded formula.

                                                                                  Equations
                                                                                  Instances For

                                                                                    Negation of an ordinary or loaded formula.

                                                                                    Equations
                                                                                    Instances For

                                                                                      Erase loading annotations from a negated loaded formula.

                                                                                      Equations
                                                                                      Instances For

                                                                                        Load a possibly already loaded formula χ with a sequence δ of boxes. The result is loaded iff δ≠[] or χ was loaded.

                                                                                        Equations
                                                                                        Instances For
                                                                                          @[simp]

                                                                                          Erase loading annotations, leaving ordinary formulas unchanged.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Spliting of loaded formulas #

                                                                                            Split any formula into the list of loaded boxes and the free formula.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Split a loaded formula into the list of loaded boxes and the free formula.

                                                                                              Equations
                                                                                              Instances For
                                                                                                theorem PDL.LoadFormula.split_inj {ξ ξ' : LoadFormula} (h : ξ.split = ξ'.split) :
                                                                                                ξ = ξ'
                                                                                                theorem PDL.AnyFormula.split_inj {ξ ξ' : AnyFormula} (h : ξ.split = ξ'.split) :
                                                                                                ξ = ξ'

                                                                                                Construct a loaded modal sequence from a list known to be nonempty.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  @[simp]
                                                                                                  theorem PDL.loadMulti_nonEmpty_box {δ : List Program} {α : Program} {h' : α :: δ ≠ []} {φ : Formula} (h : δ ≠ []) :
                                                                                                  @[simp]
                                                                                                  theorem PDL.loadMulti_split {α : Program} {φ : Formula} {αs : List Program} :
                                                                                                  (loadMulti αs α φ).split = (αs ++ [α], φ)
                                                                                                  @[simp]
                                                                                                  theorem PDL.LoadFormula.split_eq_loadMulti_nonEmpty' {δ : List Program} {φ : Formula} (lf : LoadFormula) (h : δ ≠ []) (h2 : lf.split = (δ, φ)) :
                                                                                                  lf = loadMultiNonEmpty δ h φ
                                                                                                  theorem PDL.loadMulti_nonEmpty_eq_loadMulti {δ : List Program} {α : Program} {h : δ ++ [α] ≠ []} {φ : Formula} :
                                                                                                  loadMultiNonEmpty (δ ++ [α]) h φ = loadMulti δ α φ
                                                                                                  theorem PDL.LoadFormula.split_eq_loadMulti (lf : LoadFormula) {δ : List Program} {α : Program} {φ : Formula} (h : lf.split = (δ ++ [α], φ)) :
                                                                                                  lf = loadMulti δ α φ
                                                                                                  theorem PDL.LoadFormula.exists_splitLast (lf : LoadFormula) :
                                                                                                  ∃ (δ : List Program) (α : Program), lf.split.1 = δ ++ [α]
                                                                                                  theorem PDL.LoadFormula.exists_loadMulti (lf : LoadFormula) :
                                                                                                  ∃ (δ : List Program) (α : Program) (φ : Formula), lf = loadMulti δ α φ
                                                                                                  theorem PDL.loadMulti_eq_of_some {d : Program} {δ : List Program} {β : Program} {φ : Formula} (h : δ.head? = some d) :

                                                                                                  splitLast #

                                                                                                  def PDL.splitLast {α : Type u_1} :
                                                                                                  List α → Option (List α × α)

                                                                                                  Helper function for YsetLoad' to get last list element.

                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    @[simp]
                                                                                                    theorem PDL.splitLast_nil {α : Type u_1} :
                                                                                                    theorem PDL.nil_of_splitLast_none {α : Type u_1} {δs : List α} :
                                                                                                    splitLast δs = none → δs = []
                                                                                                    theorem PDL.splitLast_cons_eq_some {α : Type u_1} (x : α) (xs : List α) :
                                                                                                    splitLast (x :: xs) = some ((x :: xs).dropLast, (x :: xs).getLast ⋯)
                                                                                                    @[simp]
                                                                                                    theorem PDL.splitLast_append_singleton {α : Type u_1} {xs : List α} {x : α} :
                                                                                                    splitLast (xs ++ [x]) = some (xs, x)
                                                                                                    theorem PDL.splitLast_inj {α : Type u_1} {xs ys : List α} (h : splitLast xs = splitLast ys) :
                                                                                                    xs = ys
                                                                                                    theorem PDL.LoadFormula.split_splitLast_to_loadBoxes {δs : List Program} {φ : Formula} {δs_ : List Program} {δ : Program} {ξ : AnyFormula} (ξsp_def : ξ.split = (δs, φ)) (sp_def : splitLast δs = some (δs_, δ)) :
                                                                                                    theorem PDL.splitLast_undo_of_some {α : Type u_1} {αs : List α} {βs_b : List α × α} (h : splitLast αs = some βs_b) :
                                                                                                    βs_b.1 ++ [βs_b.2] = αs
                                                                                                    theorem PDL.loadMulti_of_splitLast_cons {α : Program} {αs βs : List Program} {β : Program} {φ : Formula} (h : splitLast (α :: αs) = some (βs, β)) :

                                                                                                    Measures #

                                                                                                    class PDL.HasLength (α : Type) :

                                                                                                    Types equipped with a natural-valued syntactic length.

                                                                                                    • lengthOf : α → ℕ

                                                                                                      The syntactic length of an object.

                                                                                                    Instances
                                                                                                      @[instance_reducible]
                                                                                                      Equations
                                                                                                      @[instance_reducible]
                                                                                                      Equations
                                                                                                      @[instance_reducible]
                                                                                                      Equations
                                                                                                      @[instance_reducible]
                                                                                                      Equations
                                                                                                      @[instance_reducible]
                                                                                                      Equations

                                                                                                      No formula is its own double negation.

                                                                                                      theorem PDL.pair_neg_ne_singleton (φ ψ : Formula) :
                                                                                                      {φ, φ.neg} ≠ {ψ}

                                                                                                      A pair {φ, ~φ} is never a singleton.

                                                                                                      theorem PDL.pair_neg_inj {φ ψ : Formula} (h : {φ, φ.neg} = {ψ, ψ.neg}) :
                                                                                                      φ = ψ

                                                                                                      The pairs {φ, ~φ} determine φ.

                                                                                                      Sorting formulas #

                                                                                                      Needed to convert a Finset Formula to List Formula.

                                                                                                      TODO: make this a separate file

                                                                                                      Order: ⊥ < p < ¬φ < φ1∧φ2 < [α]φ

                                                                                                      Note that we want this to be antisymmetric later, so we cannot just use < on some measure. An alternative approach here would be to even go for Denumerable.

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        The recursive ordering of program syntax used for finite enumerations.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          @[instance_reducible]
                                                                                                          Equations
                                                                                                          @[instance_reducible]
                                                                                                          Equations
                                                                                                          @[instance_reducible]
                                                                                                          Equations
                                                                                                          @[instance_reducible]
                                                                                                          Equations

                                                                                                          Deciding the order #

                                                                                                          The order on formulas is decidable.

                                                                                                          Equations
                                                                                                          Instances For
                                                                                                            def PDL.Program.decLe (α β : Program) :
                                                                                                            Decidable (α.le β)

                                                                                                            The order on programs is decidable.

                                                                                                            Equations
                                                                                                            Instances For

                                                                                                              The order is a linear order #

                                                                                                              theorem PDL.Formula.le_rfl (φ : Formula) :
                                                                                                              φ.le φ

                                                                                                              The order on formulas is reflexive.

                                                                                                              theorem PDL.Program.le_rfl (α : Program) :
                                                                                                              α.le α

                                                                                                              The order on programs is reflexive.

                                                                                                              theorem PDL.Formula.le_antisymm (φ ψ : Formula) :
                                                                                                              φ.le ψ → ψ.le φ → φ = ψ

                                                                                                              The order on formulas is antisymmetric.

                                                                                                              theorem PDL.Program.le_antisymm (α β : Program) :
                                                                                                              α.le β → β.le α → α = β

                                                                                                              The order on programs is antisymmetric.

                                                                                                              theorem PDL.Formula.le_total (φ ψ : Formula) :
                                                                                                              φ.le ψ ∨ ψ.le φ

                                                                                                              The order on formulas is total.

                                                                                                              theorem PDL.Program.le_total (α β : Program) :
                                                                                                              α.le β ∨ β.le α

                                                                                                              The order on programs is total.

                                                                                                              theorem PDL.Formula.le_trans_aux (φ ψ χ : Formula) :
                                                                                                              φ.le ψ → ψ.le χ → φ.le χ

                                                                                                              The order on formulas is transitive.

                                                                                                              theorem PDL.Program.le_trans_aux (α β γ : Program) :
                                                                                                              α.le β → β.le γ → α.le γ

                                                                                                              The order on programs is transitive.

                                                                                                              theorem PDL.Formula.le_trans (f g h : Formula) :
                                                                                                              f ≤ g → g ≤ h → f ≤ h
                                                                                                              instance PDL.instTotalFormulaLe :
                                                                                                              Std.Total fun (a b : Formula) => a ≤ b

                                                                                                              List the elements of a formula finset in the fixed formula order.

                                                                                                              Equations
                                                                                                              Instances For
                                                                                                                @[simp]