Documentation

Pdl.Local.AllLocalTab

Generating all Local Tableaux #

We show that for any X the type LocalTableau is finite.

This is needed to define BuildTree as a finite tree.

Helpers about Finset.fsort #

@[simp]
theorem fsort_eq_singleton {X : Finset Formula} {a : Formula} (h : X.fsort = [a]) :
X = {a}
theorem fsort_eq_pair {X : Finset Formula} {a b : Formula} (h : X.fsort = [a, b]) :
X = {a, b}

A sublist of the sorted version of L gives a subset of L.

theorem exists_sublist_fsort_of_subset {L Lcond : Finset Formula} (h : LcondL) :
lL.fsort.sublists, l.toFinset = Lcond

Any subset of L arises from a sublist of the sorted version of L.

theorem Olf.subset_self (o : Olf) :
o o
theorem Formula.ne_neg (φ : Formula) :
φ ~φ
theorem Formula.ne_neg_neg (φ : Formula) :
φ ~~φ
theorem pair_neg_cases {φ a b : Formula} (h : {φ, ~φ} = {a, b}) (hab : a b) :
a = φ b = ~φ a = ~φ b = φ

If {φ, ~φ} = {a, b} with a ≠ b then the pair is one of the two obvious ones.

All one-sided local rules #

def osrCast {L L' : Finset Formula} {B : Finset (Finset Formula)} (h : L = L') (r : OneSidedLocalRule L' B) :

Transport a OneSidedLocalRule along an equality of preconditions.

Equations
Instances For
    @[simp]
    theorem osrCast_self {L : Finset Formula} {B : Finset (Finset Formula)} (h : L = L) (r : OneSidedLocalRule L B) :
    osrCast h r = r

    Given the sorted list of the formulas in L, is there a OneSidedLocalRule for L? The pair case comes first so that the equations below hold by rfl.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem OneSidedLocalRule.ofSorted_pair {L : Finset Formula} {a b : Formula} (h : L.fsort = [a, b]) :
      ofSorted L [a, b] h = if hb : b = ~a then some , osrCast (not a) else if ha : a = ~b then some , osrCast (not b) else none
      theorem OneSidedLocalRule.ofSorted_con {L : Finset Formula} {φ ψ : Formula} (h : L.fsort = [φ ψ]) :
      ofSorted L [φ ψ] h = some {{φ, ψ}}, osrCast (con φ ψ)
      theorem OneSidedLocalRule.ofSorted_nCo {L : Finset Formula} {φ ψ : Formula} (h : L.fsort = [~(φ ψ)]) :
      ofSorted L [~(φ ψ)] h = some {{~φ}, {~ψ}}, osrCast (nCo φ ψ)
      theorem OneSidedLocalRule.ofSorted_box {L : Finset Formula} {α : Program} {φ : Formula} (h : L.fsort = [αφ]) :
      ofSorted L [αφ] h = if notAtm : ¬α.isAtomic then some (unfoldBox α φ).toFinFin, osrCast (box α φ notAtm) else none
      theorem OneSidedLocalRule.ofSorted_dia {L : Finset Formula} {α : Program} {φ : Formula} (h : L.fsort = [~αφ]) :
      ofSorted L [~αφ] h = if notAtm : ¬α.isAtomic then some (unfoldDiamond α φ).toFinFin, osrCast (dia α φ notAtm) else none
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      All load rules #

      Given a negated loaded formula, is there a LoadRule applicable to it?

      Equations
      Instances For
        theorem LoadRule.the_spec {χ : LoadFormula} {ress : Finset (Finset Formula × Option NegLoadFormula)} (lor : LoadRule (~'χ) ress) :
        some ress, lor = the (~'χ)
        @[instance_reducible]
        Equations

        All local rules #

        def lrCast {c c' : Sequent} {ress : Finset Sequent} (h : c = c') (r : LocalRule c' ress) :
        LocalRule c ress

        Transport a LocalRule along an equality of the conditions.

        Equations
        Instances For
          @[simp]
          theorem lrCast_self {c : Sequent} {ress : Finset Sequent} (h : c = c) (r : LocalRule c ress) :
          lrCast h r = r
          def LocalRule.negPairOf (L R : Finset Formula) (lL lR : List Formula) :
          L.fsort = lLR.fsort = lROption ((ress : Finset Sequent) × LocalRule (L, R, none) ress)

          Helper for LocalRule.all, dealing with the two closing rules LRnegL and LRnegR.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem LocalRule.negPairOf_singletons {L R : Finset Formula} {φ1 φ2 : Formula} (hL : L.fsort = [φ1]) (hR : R.fsort = [φ2]) :
            negPairOf L R [φ1] [φ2] hL hR = if h : φ2 = ~φ1 then some , lrCast (LRnegL φ1) else if h : φ1 = ~φ2 then some , lrCast (LRnegR φ2) else none
            def LocalRule.all (cond : Sequent) :
            Option ((ress : Finset Sequent) × LocalRule cond ress)

            Given a subsequent cond to be replaced, is there an applicable local rule? Note that cond are only the principal formulas, not the whole sequent.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem LocalRule.all_none (L R : Finset Formula) :
              all (L, R, none) = if hR : R = then Option.map (fun (x : (B : Finset (Finset Formula)) × OneSidedLocalRule L B) => match x with | fst, orule => Finset.image (fun (res : Finset Formula) => (res, , none)) fst, lrCast (oneSidedL orule )) (OneSidedLocalRule.all L) else if hL : L = then Option.map (fun (x : (B : Finset (Finset Formula)) × OneSidedLocalRule R B) => match x with | fst, orule => Finset.image (fun (res : Finset Formula) => (, res, none)) fst, lrCast (oneSidedR orule )) (OneSidedLocalRule.all R) else negPairOf L R L.fsort R.fsort
              theorem LocalRule.all_inl_loaded (L R : Finset Formula) (α : Program) (χ : LoadFormula) :
              all (L, R, some (Sum.inl (~'αAnyFormula.loaded χ))) = if hL : L = then if hR : R = then if notAtm : ¬α.isAtomic then some Finset.image (fun (x : Finset Formula × Option NegLoadFormula) => match x with | (X, o) => (X, , Option.map Sum.inl o)) (unfoldDiamondLoaded α χ).toFinFinOpt, lrCast (loadedL (αAnyFormula.loaded χ) (LoadRule.dia notAtm) ) else none else none else none
              theorem LocalRule.all_inl_normal (L R : Finset Formula) (α : Program) (φ : Formula) :
              all (L, R, some (Sum.inl (~'αAnyFormula.normal φ))) = if hL : L = then if hR : R = then if notAtm : ¬α.isAtomic then some Finset.image (fun (x : Finset Formula × Option NegLoadFormula) => match x with | (X, o) => (X, , Option.map Sum.inl o)) (unfoldDiamondLoaded' α φ).toFinFinOpt, lrCast (loadedL (αAnyFormula.normal φ) (LoadRule.dia' notAtm) ) else none else none else none
              theorem LocalRule.all_inr_loaded (L R : Finset Formula) (α : Program) (χ : LoadFormula) :
              all (L, R, some (Sum.inr (~'αAnyFormula.loaded χ))) = if hL : L = then if hR : R = then if notAtm : ¬α.isAtomic then some Finset.image (fun (x : Finset Formula × Option NegLoadFormula) => match x with | (X, o) => (, X, Option.map Sum.inr o)) (unfoldDiamondLoaded α χ).toFinFinOpt, lrCast (loadedR (αAnyFormula.loaded χ) (LoadRule.dia notAtm) ) else none else none else none
              theorem LocalRule.all_inr_normal (L R : Finset Formula) (α : Program) (φ : Formula) :
              all (L, R, some (Sum.inr (~'αAnyFormula.normal φ))) = if hL : L = then if hR : R = then if notAtm : ¬α.isAtomic then some Finset.image (fun (x : Finset Formula × Option NegLoadFormula) => match x with | (X, o) => (, X, Option.map Sum.inr o)) (unfoldDiamondLoaded' α φ).toFinFinOpt, lrCast (loadedR (αAnyFormula.normal φ) (LoadRule.dia' notAtm) ) else none else none else none
              theorem LocalRule.negPairOf_eq {L R : Finset Formula} {lL lR : List Formula} (hL : L.fsort = lL) (hR : R.fsort = lR) :
              negPairOf L R L.fsort R.fsort = negPairOf L R lL lR hL hR
              theorem LocalRule.all_spec {L : Sequent} {B : Finset Sequent} (lr : LocalRule L B) :
              B, lr all L
              @[instance_reducible]
              instance LocalRule.fintype {X : Sequent} {ress : Finset Sequent} :
              Equations

              All local rule applications #

              Given a sequent, return a list of all possible local rule applications.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem LocalRuleApp.all_X (X : Sequent) (lra : LocalRuleApp) :
                lra all Xlra.X = X

                Termination measure for local tableaux #

                def lmOfOlf :
                Olf
                Equations
                Instances For

                  Local measure of a sequent: the sum of lmOfFormula over all three components.

                  Equations
                  Instances For

                    Local measure of an optional negated loaded formula.

                    Equations
                    Instances For

                      Helpers to show that local rules decrease the measure #

                      theorem lm_sum_union_le (A B : Finset Formula) :
                      φA B, lmOfFormula φ φA, lmOfFormula φ + φB, lmOfFormula φ

                      The measure sum over a union is at most the sum of the measure sums.

                      theorem lm_sum_Dset_le_tests {α : Program} {F : List Formula} {δ : List Program} (in_D : (F, δ) Dset α) :
                      ψF.toFinset, lmOfFormula ψ (List.map (fun (τ : { x : Formula // x testsOfProgram α }) => lmOfFormula τ) (testsOfProgram α).attach).sum

                      For (F,δ) ∈ Dset α the measure sum over F is at most the test measure of α.

                      theorem lm_dia_eq {α : Program} {φ : Formula} (h : ¬α.isAtomic) :

                      Unfolding the measure of a diamond with a non-atomic program.

                      theorem OneSidedLocalRule.decreases_lm {precond : Finset Formula} {ress : Finset (Finset Formula)} (orule : OneSidedLocalRule precond ress) (res : Finset Formula) :
                      res ressφres, lmOfFormula φ < φprecond, lmOfFormula φ

                      One-sided local rules strictly decrease the measure sum.

                      theorem LoadRule.decreases_lm {χ : LoadFormula} {ress : Finset (Finset Formula × Option NegLoadFormula)} (lrule : LoadRule (~'χ) ress) (Fo : Finset Formula × Option NegLoadFormula) :
                      Fo ressψFo.1, lmOfFormula ψ + lmOfONlf Fo.2 < lmOfFormula (~χ.unload)

                      Loaded rules strictly decrease the measure: the new formulas together with the new loaded formula have a smaller measure than the old loaded formula.

                      Generating all local tableaux #

                      def combo {α : Type} [DecidableEq α] {q : αType} {L : List α} (f : (x : α) → x LList (q x)) :
                      List ((x : α) → x Lq x)

                      Convert a function returning lists into a list of functions. Helper for LocalTableau.all.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      • combo x_2 = [fun (x : α) (x_in : x []) => .elim]
                      Instances For
                        theorem combo_mem_of_forall_in {α : Type} [DecidableEq α] {q : αType} {L : List α} (f : (x : α) → x LList (q x)) (g : (x : α) → x Lq x) :
                        (∀ (x : α) (x_in : x L), g x x_in f x x_in)g combo f

                        Characterization of members of combo result. Could be strengthened to ↔ later.

                        def comboF {q : SequentType} (s : Finset Sequent) (f : (x : Sequent) → x sList (q x)) :
                        List ((x : Sequent) → x sq x)

                        Version of combo for Finsets.

                        Equations
                        Instances For
                          theorem comboF_mem_of_forall_in {q : SequentType} {s : Finset Sequent} (f : (x : Sequent) → x sList (q x)) (g : (x : Sequent) → x sq x) (h : ∀ (x : Sequent) (x_in : x s), g x x_in f x x_in) :
                          g comboF s f
                          @[irreducible]
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem LocalTableau.all_spec {X : Sequent} {ltX : LocalTableau X} :
                            ltX all X
                            @[instance_reducible]
                            Equations

                            Generating all Open Local Tableaux #

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