Documentation

Pdl.BuildTreeModel

From winning strategies to model graphs, part 2: the model graph (Section 6.3) #

This continues Pdl/BuildTree.lean. Here we define the model graph BuildTree.toModel obtained from a BuildTree (Definition 6.17) and provide the infrastructure that is used in Pdl/BuildTreeExistence.lean to prove the existence lemmas.

Defining The Model Graph #

Definition 6.17 to get model graph from strategy tree.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem PreState.mem_toModel {X : Sequent} {bt : BuildTree [] X} {π : PreState bt} :

    Helper lemma saying (the formula sets of) all pre-states are in the model graph.

    Infrastructure for the existence lemmas #

    The existence lemmas 6.18, 6.19 and 6.20 all have the same shape: given a pre-state π and a (possibly loaded) diamond in it, find another pre-state ρ that is reached from π by the corresponding Q relation. All of them are proven by walking through the BuildTree: we go to the last node of π (which is basic), apply some PdlRules there, and then pick a pre-state collected at the node we arrive at. The lemmas in this section provide the tools for these steps.

    def PreState.toW {X : Sequent} {bt : BuildTree [] X} (π : PreState bt) :

    The world of the model graph given by a pre-state.

    Equations
    Instances For
      @[simp]
      theorem PreState.toW_val {X : Sequent} {bt : BuildTree [] X} (π : PreState bt) :
      π.toW = π.forms
      theorem PreState.rel_iff {X : Sequent} {bt : BuildTree [] X} {π ρ : PreState bt} {a : } :

      Unfolding the atomic accessibility relation of BuildTree.toModel.

      Set-equal sequents #

      Set-equal sequents have the same formulas on both sides.

      theorem AnyNegFormula.mem_Sequent_of_setEqTo {Z Z' : Sequent} (h : Z.setEqTo Z') {anf : AnyNegFormula} (hmem : mem_Sequent Z anf) :

      Set-equal sequents contain the same AnyNegFormulas.

      Formulas of a pre-state #

      theorem PreState.mem_forms_of_mem {H : History} {X : Sequent} {bt : BuildTree H X} {π : PreState bt} {Z : Sequent} (hZ : Z π) {f : Formula} (hf : f Z.bothSides) :
      f π.forms
      theorem PreState.mem_wForms_of_mem {H : History} {X : Sequent} {bt : BuildTree H X} {π : PreState bt} {Z : Sequent} (hZ : Z π) {f : WhateverFormula} (hf : f Z.wForms) :
      f π.wForms
      theorem PreState.getLast_mem {H : History} {X : Sequent} {bt : BuildTree H X} (π : PreState bt) :
      (↑π).getLast π

      The last sequent of a pre-state is one of its sequents.

      def PreState.hasAnf {H : History} {X : Sequent} {bt : BuildTree H X} (π : PreState bt) (anf : AnyNegFormula) :

      A pre-state "has" an AnyNegFormula if one of its sequents contains it.

      Equations
      Instances For
        theorem PreState.mem_forms_of_hasAnf {H : History} {X : Sequent} {bt : BuildTree H X} {π : PreState bt} {ξ : AnyFormula} (h : π.hasAnf (~''ξ)) :

        If a pre-state has ~''ξ then the unloaded formula ~ξ.unload is among its formulas.

        Walking down the BuildTree #

        theorem Match.btAt_size_le {H : History} {X : Sequent} {bt : BuildTree H X} (m : Match bt) :

        The sub-BuildTree reached by a Match is not bigger than the whole tree.

        theorem BuildTree.exists_match_of_pdlRule {H : History} {Z : Sequent} (bt : BuildTree H Z) (bas : Z.basic) (nfr : ¬bt.isFreeRepeat) {Y : Sequent} (r : PdlRule Z Y) :
        ∃ (m : Match bt), m.btAt.snd.fst = Y m.btAt.snd.snd.size < bt.size

        If a PdlRule is applicable at the root of a BuildTree that is basic and not a free repeat, then the tree has a corresponding child, reached by a one-step Match.

        theorem Match.exists_step {H : History} {X : Sequent} {bt : BuildTree H X} (m : Match bt) (bas : m.endSeq.basic) (nfr : ¬m.btAt.snd.snd.isFreeRepeat) {Y : Sequent} (r : PdlRule m.endSeq Y) :
        ∃ (m' : Match bt), m'.endSeq = Y m'.btAt.snd.snd.size < m.btAt.snd.snd.size

        Making a PdlRule step at the end of a Match: we get a longer Match that ends at the child sequent, and the sub-BuildTree we reach is strictly smaller.

        A Match ending in a loaded sequent is never at a free repeat.

        @[irreducible]

        Any Match can be replaced by one that ends at a set-equal sequent and is not at a free repeat: if we are at a free repeat we go to its companion, which is strictly shorter.

        theorem Match.exists_preState_of_not_freeRepeat {X : Sequent} {bt : BuildTree [] X} (m : Match bt) (nfr : ¬m.btAt.snd.snd.isFreeRepeat) :
        ∃ (ρ : PreState bt), m.endSeq ρ ∃ ( : Match bt), .endSeq = (↑ρ).getLast .btAt.snd.snd.size m.btAt.snd.snd.size

        At the end of a Match that is not a free repeat we find a pre-state that starts with the sequent we are at, and whose own last sequent is reached by a Match that goes no higher up.

        Free pre-states #

        Version of BuildTree.collect_contains_root_of_not_freeRepeat saying that the root sequent is the first sequent of the collected pre-state.

        @[irreducible]
        theorem PreState.O_getLast_eq_none {H : History} {X : Sequent} {bt : BuildTree H X} (π : PreState bt) (h : ((↑π).head ).O = none) :
        ((↑π).getLast ).O = none

        If the first sequent of a pre-state is free then so is its last sequent. (Generalised to an arbitrary history H, as needed for the recursion.)

        theorem Match.exists_preState_head_of_not_freeRepeat {X : Sequent} {bt : BuildTree [] X} (m : Match bt) (nfr : ¬m.btAt.snd.snd.isFreeRepeat) :
        ∃ (ρ : PreState bt), (↑ρ).head = m.endSeq ∃ ( : Match bt), .endSeq = (↑ρ).getLast

        Version of Match.exists_preState_of_not_freeRepeat where the pre-state starts at the sequent we are at.

        The modal rule #

        theorem PdlRule.exists_modL {L R : List Formula} {a : } {ξ : AnyFormula} :
        ∃ (Y : Sequent), Nonempty (PdlRule (L, R, some (Sum.inl (~'·aξ))) Y) AnyNegFormula.mem_Sequent Y (~''ξ) (∀ (f : Formula), (·af) L ++ Rf Y.bothSides) ∀ (χ : LoadFormula), ξ = AnyFormula.loaded χY.isLoaded = true

        What the modal rule (M) gives us on the left: the child contains ~''ξ and all a-successors of the boxes in the parent, and it is loaded whenever ξ is.

        theorem PdlRule.exists_modR {L R : List Formula} {a : } {ξ : AnyFormula} :
        ∃ (Y : Sequent), Nonempty (PdlRule (L, R, some (Sum.inr (~'·aξ))) Y) AnyNegFormula.mem_Sequent Y (~''ξ) (∀ (f : Formula), (·af) L ++ Rf Y.bothSides) ∀ (χ : LoadFormula), ξ = AnyFormula.loaded χY.isLoaded = true

        What the modal rule (M) gives us on the right. Mirrors PdlRule.exists_modL.

        @[irreducible]

        An atomic loaded diamond in a pre-state occurs already in its last sequent. This is the loaded analogue of PreState.mem_bothSides_getLast_of_basic and the reason why the modal rule is applicable at the end of the pre-state. (Generalised from bt : BuildTree [] X to an arbitrary history H, as needed for the recursion into sub-BuildTrees.)

        theorem PreState.exists_mem_of_mem_wForms {H : History} {X : Sequent} {bt : BuildTree H X} {π : PreState bt} {f : WhateverFormula} (h : f π.wForms) :
        Zπ, f Z.wForms

        A normal formula in π.wForms is also in π.forms.

        The modal step #

        theorem Sequent.box_mem_LR_of_mem_bothSides {Z : Sequent} {a : } {f : Formula} (h : (·af) Z.bothSides) :
        (·af) Z.L ++ Z.R

        An atomic box in a sequent is on the left or on the right (it cannot come from the loaded formula, which is always negated).

        theorem Match.atomicLoadedStep {X : Sequent} {bt : BuildTree [] X} (m : Match bt) (bas : m.endSeq.basic) {a : } {ξ : AnyFormula} (hload : NegLoadFormula.mem_Sequent m.endSeq (~'·aξ)) :

        The modal step at the end of a Match: if the sequent we are at is basic and loaded with an atomic diamond ~'⌊·a⌋ξ, then we can go one step down, arriving at a sequent that contains ~''ξ and all a-successors of the boxes we had. Formal version of the base case of Lemma 6.18.

        theorem Match.exists_preState_setEqTo {X : Sequent} {bt : BuildTree [] X} (m : Match bt) :
        ∃ (ρ : PreState bt), Zρ, Z.setEqTo m.endSeq ∃ ( : Match bt), .endSeq = (↑ρ).getLast (m.endSeq.isLoaded = true.btAt.snd.snd.size m.btAt.snd.snd.size)

        After any Match there is a pre-state containing a sequent set-equal to the sequent we are at. If that sequent is loaded then the pre-state is found without going back up, so its last node is not higher up than where we are.

        theorem PreState.atomicLoadedStep {X : Sequent} {bt : BuildTree [] X} (π : PreState bt) ( : Match bt) (hmπ : .endSeq = (↑π).getLast ) {a : } {ξ : AnyFormula} (hload : NegLoadFormula.mem_Sequent ((↑π).getLast ) (~'·aξ)) :
        ∃ (ρ : PreState bt) ( : Match bt), .endSeq = (↑ρ).getLast (.btAt.snd.snd.size < .btAt.snd.snd.size ∃ (φ : Formula), ξ = AnyFormula.normal φ) bt.toModel.snd.Rel a π.toW ρ.toW ρ.hasAnf (~''ξ)

        Lemma 6.18 for an atomic program: the base case of the induction. If the last sequent of the pre-state π is loaded with ~'⌊·a⌋ξ, then there is a pre-state ρ with (Λ⁻(π), Λ⁻(ρ)) ∈ Rₐ that has ~''ξ. Unless ξ is a normal formula (in which case we may have to go back to a companion) the new pre-state also ends strictly below π.

        Unfolding a loaded diamond in a pre-state #

        theorem PreState.loadUnfold_of_nonAtom {H : History} {X : Sequent} {bt : BuildTree H X} {π : PreState bt} {α : Program} {ξ : AnyFormula} (α_notAtom : ¬α.isAtomic) (h : WhateverFormula.negLoad (~'αξ) π.wForms) :
        Dset α, (∀ f.1, (WhateverFormula.any AnyFormula.normal) f π.wForms) π.hasAnf (~''(AnyFormula.loadBoxes .2 ξ))

        Unified version of the loaded case of Lemma 6.15, for an arbitrary AnyFormula xi: if ~'⌊α⌋ξ occurs in the pre-state π and α is not atomic, then for one of the unfoldings (F,δ) ∈ Dset α all test formulas in F occur in π and π also has ~''⌊⌊δ⌋⌋ξ.

        theorem AnyFormula.loadBoxes_ne_normal {γs : List Program} (h : γs []) {ξ : AnyFormula} {φ : Formula} :
        loadBoxes γs ξ normal φ

        A nonempty list of boxes always gives a loaded formula.

        The Q relation for pre-states #

        A negated loaded formula is in Z.wForms iff it is "in" the sequent Z.

        theorem PreState.qcombo_of_qsteps {X : Sequent} {bt : BuildTree [] X} {F : List Formula} {δ : List Program} {π ρ : PreState bt} (hF : fF, (WhateverFormula.any AnyFormula.normal) f π.wForms) (h : Qsteps bt.toModel.snd.Rel δ π.toW ρ.toW) :
        Qcombo bt.toModel.snd.Rel F δ π.toW ρ.toW

        If all test formulas of F are in the pre-state π, then Qsteps from π gives Qcombo.