Documentation

LeanPool.PDL.Interpolation.QuasiTableau

Quasi-Tableaux (Def 9.8) #

inductive PDL.Typ :

The three node types used in constructing a pre-interpolant.

Instances For
    @[instance_reducible]
    Equations
    inductive PDL.QuasiTab :

    Simple tree data type for Q in Def. 7.31.

    Instances For

      The type k(x) of the root of a quasi-tableau.

      Equations
      Instances For

        The label Δₓ of the root of a quasi-tableau.

        Equations
        Instances For

          The children ⋖Q of the root of a quasi-tableau.

          Equations
          Instances For
            @[irreducible]

            All nodes of a quasi-tableau, each given by the subtree rooted at it.

            Equations
            Instances For

              Termination of the construction of Q #

              The construction of Q terminates because along a branch of Q the label of a node of type 1 is either a repeat or a new element of the finite list Λ₂[C], and in the latter case it is added to the history. Hence the number of elements of Λ₂[C] that are not yet in the history decreases.

              theorem PDL.countP_lt_countP_of_mem {α : Type u_1} {l : List α} {p q : α → Bool} (h : ∀ x ∈ l, p x = true → q x = true) {a : α} (ha : a ∈ l) (hq : q a = true) (hp : ¬p a = true) :
              theorem PDL.length_filter_notMem_cons_lt {α : Type u_1} [DecidableEq α] {l Hist : List α} {a : α} (ha : a ∈ l) (ha' : a ∉ Hist) :
              (List.filter (fun (z : α) => decide (z ∉ a :: Hist)) l).length < (List.filter (fun (z : α) => decide (z ∉ Hist)) l).length
              @[irreducible]
              def PDL.QuasiTab.build (inC : Finset Sequent) (step : Sequent → List Sequent) (Hist : List Sequent) (Δ : Sequent) :

              Def 9.8: the quasi-tableau, given the list inC of labels Λ₂[C] and the function step that maps a label to the labels of the children obtained by applying the right rule. Both are provided by LoadedCluster.lambdaTwo and LoadedCluster.stepOf in LoadedCluster.Q below.

              Following the paper we make the case distinction at the node of type 1: it is a leaf iff it is a repeat (i.e. Δ ∈ Hist) or Δ ∉ Λ₂[C], and in the latter case Δ ∈ Λ₂[C⁺] \ Λ₂[C] by the invariant. Otherwise it has a unique child of type 2, which has a unique child of type 3, whose children are given by step and are again of type 1. Note that only nodes of type 1 add their label to the history — this is the "identify repeats at the first opportunity" from Definition 9.11.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem PDL.QuasiTab.build_of_leaf {inC : Finset Sequent} {step : Sequent → List Sequent} {Hist : List Sequent} {Δ : Sequent} (h : ¬(Δ ∈ inC ∧ Δ ∉ Hist)) :
                build inC step Hist Δ = QNode Typ.one Δ []

                A node of Q of type 1 that is a repeat or an exit is a leaf.

                theorem PDL.QuasiTab.build_of_node {inC : Finset Sequent} {step : Sequent → List Sequent} {Hist : List Sequent} {Δ : Sequent} (h : Δ ∈ inC ∧ Δ ∉ Hist) :
                build inC step Hist Δ = QNode Typ.one Δ [QNode Typ.two Δ [QNode Typ.three Δ (List.map (fun (Pi : Sequent) => build inC step (Δ :: Hist) Pi) (step Δ))]]

                A node of Q of type 1 that is neither a repeat nor an exit has a child of type 2, which has a child of type 3, whose children are given by step.

                theorem PDL.QuasiTab.build_leaf_typ {inC : Finset Sequent} {step : Sequent → List Sequent} (hstep : ∀ Δ ∈ inC, step Δ ≠ []) (Hist : List Sequent) (Δ : Sequent) (q : QuasiTab) :
                q ∈ (build inC step Hist Δ).subtrees → q.children = [] → q.typ = Typ.one

                Remark 9.9: all leaves of the quasi-tableau have type 1. Here we need that a node of type 3 does have children, which by Lemma 9.7 (d), (e) and (f) holds for all Δ ∈ Λ₂[C].

                theorem PDL.QuasiTab.build_label_mem {inC lam : Finset Sequent} {step : Sequent → List Sequent} (hstep : ∀ (Δ Pi : Sequent), Pi ∈ step Δ → Pi ∈ lam) (Hist : List Sequent) (Δ : Sequent) :
                Δ ∈ lam → ∀ q ∈ (build inC step Hist Δ).subtrees, q.label ∈ lam

                Invariant of Def 9.8: if all labels produced by step are in lam, then all nodes of the quasi-tableau built from a label in lam are again labelled with elements of lam.

                theorem PDL.QuasiTab.build_inner_label_mem {inC : Finset Sequent} {step : Sequent → List Sequent} (Hist : List Sequent) (Δ : Sequent) (q : QuasiTab) :
                q ∈ (build inC step Hist Δ).subtrees → q.children ≠ [] → q.label ∈ inC

                The invariant of Def 9.8: every node of the quasi-tableau that is not a leaf has a label in Λ₂[C], i.e. C_{Δₓ} ≠ ∅ by LoadedCluster.mem_lambdaTwo_iff.

                The right component of the root of the cluster is in Λ₂[C].

                noncomputable def PDL.LoadedCluster.Q {X : Sequent} {tab : Tableau [] X} (C : LoadedCluster tab) :

                Def 9.8: the quasi-tableau associated with the cluster C. Its root has type 1 and is labelled with the right component Λ₂(r) of the root r of the cluster.

                Equations
                Instances For
                  @[simp]
                  theorem PDL.LoadedCluster.Q_typ {X : Sequent} {tab : Tableau [] X} (C : LoadedCluster tab) :
                  @[simp]

                  All nodes of Q are labelled with elements of Λ₂[C⁺].

                  The invariant of Def 9.8 for Q: every inner node of Q has a label in Λ₂[C].

                  theorem PDL.LoadedCluster.Q_leaf_typ {X : Sequent} {tab : Tableau [] X} (C : LoadedCluster tab) (h97d : ∀ Δ ∈ C.lambdaTwo, C.nodesWithFineRight Δ ≠ []) (q : QuasiTab) :
                  q ∈ C.Q.subtrees → q.children = [] → q.typ = Typ.one

                  Remark 9.9 for Q: all leaves of the quasi-tableau have type 1. Here h97d is Lemma 9.7 (d), which we state as a hypothesis: for every label in Λ₂[C] there is a node of the cluster with that right component where a right rule is applied.

                  noncomputable def PDL.LoadedCluster.region {X : Sequent} {tab : Tableau [] X} (C : LoadedCluster tab) :

                  Def 9.10: the region Rₓ ⊆ C⁺ represented by a node x of the quasi-tableau. For type 1 and 2 these are all nodes of C⁺ with right component Δₓ, and for type 3 those nodes of C with right component Δₓ where a right rule is applied.

                  Equations
                  Instances For
                    noncomputable def PDL.LoadedCluster.regionOf {X : Sequent} {tab : Tableau [] X} (C : LoadedCluster tab) (q : QuasiTab) :

                    Def 9.10, applied to a node of the quasi-tableau.

                    Equations
                    Instances For

                      Addresses: the nodes of a quasi-tableau (Def 9.11) #

                      QuasiTab is an inductive tree, so its nodes are not determined by their type and label: several nodes of Q may carry the same type and the same label. To speak about the nodes of Q, and in particular about the tree order <_Q needed for repeats and companions, we identify a node with its address, i.e. with the list of child indices that leads to it from the root. Hence r_Q is the empty address, x ≤_Q y becomes "x is a prefix of y" and x <_Q y becomes "x is a proper prefix of y".

                      The subtree of q rooted at the node with address x, if there is such a node.

                      Equations
                      Instances For

                        Is there a node at address x in q?

                        Equations
                        Instances For
                          @[irreducible]

                          The set Q of all nodes, given by their addresses.

                          Equations
                          Instances For

                            The label Δₓ of the node at address x.

                            Equations
                            Instances For

                              The type k(x) of the node at address x.

                              Equations
                              Instances For

                                The addresses of the children of the node at address x.

                                Equations
                                Instances For

                                  Is the node at address x a leaf? (Also false when there is no node at x.)

                                  Equations
                                  Instances For

                                    L_Q, the set of leaves.

                                    Equations
                                    Instances For

                                      r_Q, the root.

                                      Equations
                                      Instances For

                                        x ≤_Q y, the reflexive-transitive closure of ⋖Q, which on addresses is the prefix order.

                                        Equations
                                        Instances For

                                          x <_Q y, the transitive closure of ⋖Q, which on addresses is the proper prefix order.

                                          Equations
                                          Instances For

                                            x ⋖Q y, i.e. y is a child of x.

                                            Equations
                                            Instances For

                                              Def 9.11: the companion c(x) of a repeat leaf x, that is, the node z <_Q x of type 1 with the same label as x. Because repeats are identified at the first opportunity there is at most one such node in a quasi-tableau; here we simply take the one closest to the root.

                                              Equations
                                              Instances For

                                                Def 9.8: x is a repeat leaf of q, i.e. a leaf of type 1 that has a companion.

                                                Equations
                                                Instances For

                                                  All repeat leaves of q.

                                                  Equations
                                                  Instances For

                                                    Def 9.11: K_Q, the set of companions.

                                                    Equations
                                                    Instances For

                                                      Def 9.11: cycs(x), the set of repeat leaves z with c(z) <_Q x ≤_Q z, i.e. the repeat leaves below x whose companion is a proper ancestor of x.

                                                      Equations
                                                      Instances For
                                                        theorem PDL.QuasiTab.mem_cycs_iff (q : QuasiTab) (x z : List ℕ) :
                                                        z ∈ q.cycs x ↔ z ∈ q.repeatLeaves ∧ ∃ (c : List ℕ), q.companionOpt z = some c ∧ qlt c x ∧ qle x z

                                                        Basic facts about addresses #

                                                        These general facts about atOpt, addresses, subtrees and childrenAt are used both here and in the files building on this one.

                                                        theorem PDL.QuasiTab.atOpt_cons_none {q : QuasiTab} {i : ℕ} {rest : List ℕ} (h : q.children[i]? = none) :
                                                        q.atOpt (i :: rest) = none
                                                        theorem PDL.QuasiTab.atOpt_append (q : QuasiTab) (x w : List ℕ) :
                                                        q.atOpt (x ++ w) = (q.atOpt x).bind fun (n : QuasiTab) => n.atOpt w

                                                        Every address of a node of q is in q.addresses.

                                                        theorem PDL.QuasiTab.mem_subtrees_of_atOpt {q n : QuasiTab} {x : List ℕ} (h : q.atOpt x = some n) :

                                                        The node at an address is one of the subtrees.

                                                        theorem PDL.QuasiTab.childrenAt_of_atOpt {q n : QuasiTab} {x : List ℕ} (hx : q.atOpt x = some n) :
                                                        q.childrenAt x = List.map (fun (i : ℕ) => x ++ [i]) (List.range n.children.length)

                                                        Lemma 9.12 #

                                                        Lemma 9.12 (a), first half: a repeat leaf has type 1.

                                                        Lemma 9.12 (a), second half: a companion node has type 1.

                                                        Lemma 9.12 (b): the root has no cycles below it, cycs(r_Q) = ∅.

                                                        theorem PDL.QuasiTab.mem_cycs_of_mem_cycs_of_qlt (q : QuasiTab) {x y z : List ℕ} (hxy : qlt x y) (hz : z ∈ q.cycs x) (hyz : qle y z) :
                                                        z ∈ q.cycs y

                                                        Lemma 9.12 (c) does not hold as stated in the paper: from x <_Q y we cannot conclude cycs(x) ⊆ cycs(y), because a repeat leaf z ∈ cycs(x) may lie below a different child of x than y does. (For counterexamples, and for a precise account of when (c) does hold, see the file Pdl.ClusterCorrection.) What does hold — and what the proofs in the paper actually use — is the following version, where we additionally demand y ≤_Q z.

                                                        theorem PDL.QuasiTab.cycs_subset_of_qedge (q : QuasiTab) {x y : List ℕ} (hx : x ∉ q.companions) (hxy : q.qedge x y) (z : List ℕ) :
                                                        z ∈ q.cycs y → z ∈ q.cycs x

                                                        Lemma 9.12 (d) does not hold as stated in the paper either: when x has several children then the inclusion cycs(y) ⊆ cycs(x) may be strict. (For counterexamples, and for a precise account of when equality does hold — namely whenever x has at most one child, hence at all nodes of a quasi-tableau of a cluster that are not of type 3 — see the file Pdl.ClusterCorrection.) Here is the inclusion that does hold in general, and it is the direction that the proofs in the paper actually use.