Documentation

Pdl.TableauGame

The Tableau Game (Section 6.2) #

Prover and Builder positions #

Equations
Instances For
    Equations
    Instances For
      inductive ProverPos (H : History) (X : Sequent) :
      Instances For
        inductive BuilderPos (H : History) (X : Sequent) :
        Instances For
          def instDecidableEqBuilderPos.decEq {H✝ : History} {X✝ : Sequent} (x✝ x✝¹ : BuilderPos H✝ X✝) :
          Decidable (x✝ = x✝¹)
          Equations
          Instances For
            Equations
            Instances For
              def posOf (H : History) (X : Sequent) :

              If we reach this sequent, what is the next game position? Includes winning positions.

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

                Moves #

                inductive move (old new : GamePos) :

                The relation move old next says that we can move from old to next. There are three kinds of moves.

                Instances For
                  theorem move_then_no_rep {Hist : History} {X : Sequent} {next : GamePos} {p : ProverPos Hist X BuilderPos Hist X} :
                  move Hist, X, p next¬rep Hist X

                  The finite set of moves, given as a function instead of a relation. With move_of_mem_theMoves and mem_theMoves_of_move this agrees with move.

                  Equations
                  Instances For
                    theorem theMoves_iff {H : History} {X : Sequent} {p : ProverPos H X BuilderPos H X} {next : GamePos} :
                    next theMoves H, X, p (∃ (nrep : ¬rep H X) (Xbasic : X.basic), p = Sum.inl (ProverPos.bas nrep Xbasic) ∃ (L : List Formula) (R : List Formula), X = (L, R, none) ((∃ (δs : List Program) (δ : Program) (ψ : Formula), ¬ψ.isBox (~⌈⌈δs⌉⌉δψ) L next = X :: H, (L.erase (~⌈⌈δs⌉⌉δψ), R, some (Sum.inl (~'⌊⌊δs⌋⌋δAnyFormula.normal ψ))), posOf (X :: H) (L.erase (~⌈⌈δs⌉⌉δψ), R, some (Sum.inl (~'⌊⌊δs⌋⌋δAnyFormula.normal ψ)))) ∃ (δs : List Program) (δ : Program) (ψ : Formula), ¬ψ.isBox (~⌈⌈δs⌉⌉δψ) R next = X :: H, (L, R.erase (~⌈⌈δs⌉⌉δψ), some (Sum.inr (~'⌊⌊δs⌋⌋δAnyFormula.normal ψ))), posOf (X :: H) (L, R.erase (~⌈⌈δs⌉⌉δψ), some (Sum.inr (~'⌊⌊δs⌋⌋δAnyFormula.normal ψ)))) (∃ (a : ) (ξ : AnyFormula), X = (L, R, some (Sum.inl (~'·aξ))) ((∃ (φ : Formula), ξ = AnyFormula.normal φ next = X :: H, (~φ :: projection a L, projection a R, none), posOf (X :: H) (~φ :: projection a L, projection a R, none)) (∃ (χ : LoadFormula), ξ = AnyFormula.loaded χ next = X :: H, (projection a L, projection a R, some (Sum.inl (~'χ))), posOf (X :: H) (projection a L, projection a R, some (Sum.inl (~'χ)))) next = X :: H, (List.insert (~(·aξ).unload) L, R, none), posOf (X :: H) (List.insert (~(·aξ).unload) L, R, none))) ∃ (a : ) (ξ : AnyFormula), X = (L, R, some (Sum.inr (~'·aξ))) ((∃ (φ : Formula), ξ = AnyFormula.normal φ next = X :: H, (projection a L, ~φ :: projection a R, none), posOf (X :: H) (projection a L, ~φ :: projection a R, none)) (∃ (χ : LoadFormula), ξ = AnyFormula.loaded χ next = X :: H, (projection a L, projection a R, some (Sum.inr (~'χ))), posOf (X :: H) (projection a L, projection a R, some (Sum.inr (~'χ)))) next = X :: H, (L, List.insert (~(·aξ).unload) R, none), posOf (X :: H) (L, List.insert (~(·aξ).unload) R, none))) (∃ (nrep : ¬rep H X) (nbas : ¬X.basic), p = Sum.inl (ProverPos.nbas nrep nbas) ∃ (ltab : LocalTableau X), next = H, X, Sum.inr (BuilderPos.ltab nrep nbas ltab)) ∃ (nrep : ¬rep H X) (nbas : ¬X.basic) (ltab : LocalTableau X), p = Sum.inr (BuilderPos.ltab nrep nbas ltab) YendNodesOf ltab, next = X :: H, Y, posOf (X :: H) Y

                    Characterization of theMoves.

                    theorem no_moves_of_rep {Hist : History} {X : Sequent} {pos : ProverPos Hist X BuilderPos Hist X} (h : rep Hist X) :
                    theorem move_of_mem_theMoves {pos next : GamePos} :
                    next theMoves posmove pos next

                    The finite set given by theMoves indeed agrees with the relation move. Other direction is mem_theMoves_of_move.

                    theorem mem_theMoves_of_move {pos next : GamePos} :
                    move pos nextnext theMoves pos
                    theorem move.hist {Hist : History} {X : Sequent} {pos : ProverPos Hist X BuilderPos Hist X} {next : GamePos} (mov : move Hist, X, pos next) :
                    (∃ (newPos : ProverPos Hist X BuilderPos Hist X), next = Hist, X, newPos) ∃ (Y : Sequent) (newPos : ProverPos (X :: Hist) Y BuilderPos (X :: Hist) Y), next = X :: Hist, Y, newPos
                    theorem move.hist_suffix {Hist : History} {X : Sequent} {pos : ProverPos Hist X BuilderPos Hist X} {next : GamePos} (mov : move Hist, X, pos next) :
                    Hist <:+ next.fst
                    theorem move.trans_hist_suffix {pX pZ : GamePos} (movt : Relation.TransGen move pX pZ) :
                    pX.fst <:+ pZ.fst
                    theorem move.trans_hist {pX pY : GamePos} (movt : Relation.TransGen move pX pY) :
                    pX.fst = pY.fst pX.snd.fst = pY.snd.fst pX.snd.fst :: pX.fst <:+ pY.fst

                    Along the transitive closure of move either the history stays the same or the old sequent and history form a prefix of the new history (where "prefix" is actually "suffix" because the history has the newest element first).

                    Lemmas about double moves #

                    theorem move_twice_hist_length {A B C : GamePos} (A_B : move A B) (B_C : move B C) :

                    After two moves the history must grow.

                    @[reducible, inline]
                    abbrev movemove (a c : GamePos) :

                    Insert obligatory "We like to move it move it" joke here.

                    Equations
                    Instances For
                      theorem movemove.hist {A B C : GamePos} (A_B : move A B) (B_C : move B C) :

                      After any number of double moves the history gets extended.

                      Termination via finite FL closure #

                      See also StayingInFL.lean whereSequent.subseteq_FL is defined.

                      We are working with lists (or, by ignoring their order, multisets) and thus staying in the FL closure does not imply that there are only finitely many sequents reachable: by repeating the same formulas the length of the list may increase. To tackle this we want to use that rep is defined with setEqTo that ignores multiplicity, so that even if there are infinitely many different lists and thus sequents in principle reachable, we still cannot have an infinite chain because that would mean we must have a "set-repeat" that is not allowed.

                      theorem move_inside_FL {p next : GamePos} (mov : move p next) :

                      Given ~⌈α₁⌉…⌈αₙ⌉φ, return the list of ~⌊α₁⌋…⌊αₖ⌋⌈αₖ₊₁⌉…⌈αₙ⌉φ for all k.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      • x✝.allNegLoads = []
                      Instances For

                        A list of sequents that are all FL-subsequents of the given sequent. The list defined here is not complete because there are infinitely many such other sequents. But the list is exhaustive modulo setEqTo, as will be shown later via the Seqt quotient. Defined using List.instMonad.

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

                          NOTE

                          The following do NOT hold / do NOT exist because there are in fact infinitely many FL-subsequents of a given sequent, so the list returned by all_subseteq_FL can never contain all.

                          def Sequent.all_subseteq_FL_complete (X Y : Sequent) (h : Y.subseteq_FL X) :
                              ⟨Y,h⟩ ∈ Sequent.all_subseteq_FL X := ...
                          
                          instance Sequent.subseteq_FL_fintype {X : Sequent} :
                              Fintype { Y // Sequent.subseteq_FL Y X } := ...
                          

                          Hence, we now define the Quotient modulo Sequent.setEqTo within which there are only finitely many FL-subsequents.

                          TODO move Seqt to Sequent.lean and Sequent.subseteq_FL_congr to FischerLadner.lean later?

                          @[reducible, inline]
                          abbrev Seqt :

                          Yes, it's a pun. A Sequent modulo Sequent.setEqTo.

                          Equations
                          Instances For

                            Needed to make List.toFinset work for List Seqt. Strange that this is not inferred from instDecidableRelSequentSetEqTo automatically.

                            Equations
                            theorem Sequent.subseteq_FL_congr (a₁ b₁ a₂ b₂ : Sequent) :
                            a₁ a₂b₁ b₂a₁.subseteq_FL b₁ = a₂.subseteq_FL b₂

                            Congruence for Sequent.subseteq_FL, used to make Seqt.subseteq_FL well-defined.

                            In the quotient the moves keep us inside the FL. UNUSED, delete this?

                            theorem exists_mem_sublists_toFinsetEq_of_Subset {α : Type u_1} [DecidableEq α] {A B : List α} :
                            A BCB.sublists, C.toFinset = A.toFinset

                            Small helper function. Mathlib this?

                            theorem Seqt.all_subseteq_FL_spec {Xs Ys : Seqt} (Ys_in : Ys Xs.all_subseteq_FL) :
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              Equations
                              • =
                              Instances For

                                In the quotient for setEqTo there are only finitely many FL-subsets for a given Seqt. This means "there are only finitely many "sequents modulo setEq" that are subseteq_FL Y.

                                theorem help {α : Type} {f : α} {p : αProp} (h_p : ∀ (n : ), p (f n)) (h_fin : Finite { x : α // p x }) :
                                ∃ (k1 : ) (k2 : ), k1 k2 f k1 = f k2

                                General helper lemma: If we have an enumeration of infinitely many values, and all of them have a certain property, but we also know that there are only finitely many values with that property, then there must be identical values in the enuemration.

                                Lemma 6.10. The move relation is converse wellfounded (and thus all matches must be finite). Note that the paper does not prove this, only says it is similar to the proof that PDL-tableaux are finite, i.e. Lemma 4.10 which uses the Fischer-Ladner closure.

                                Actual Game Definition #

                                The game defined in Section 6.2.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[simp]
                                  theorem tableauGame_turn_Prover {Hist : History} {X : Sequent} {lpr : ProverPos Hist X} :
                                  @[simp]
                                  theorem tableauGame_turn_Builder {Hist : History} {X : Sequent} {lpr : BuilderPos Hist X} :
                                  @[simp]
                                  theorem tableauGame_winner_nlpRep_eq_Builder {i : Player} {sI : Strategy tableauGame i} {sJ : Strategy tableauGame (other i)} {Hist : History} {X : Sequent} {h1 : rep Hist X} {h2 : ¬Nonempty (LoadedPathRepeat Hist X)} :

                                  From Prover winning strategies to tableau #

                                  @[irreducible]
                                  theorem gameP_general (Hist : History) (X : Sequent) (sP : Strategy tableauGame Prover) (pos : ProverPos Hist X BuilderPos Hist X) (h : winning sP Hist, X, pos) :
                                  Nonempty (Tableau Hist X)

                                  After history Hist, if Prover has a winning strategy then there is a closed tableau. Note: we skip Definition 6.9 (Strategy Tree for Prover) and just use the Strategy type. This is the induction loading for gameP.

                                  The starting position for the given sequent. With an empty history and using posOf to determine the first GamePos.

                                  Equations
                                  Instances For
                                    theorem gameP (X : Sequent) (s : Strategy tableauGame Prover) (h : winning s (startPos X)) :

                                    If Prover has a winning strategy then there is a closed tableau.