The Tableau Game (Section 6.2) #
Different from the paper proof, here we directly set up the tableau game such that we
also get a uniform tableau: Prover is not free to choose any local tableau: at a
non-basic sequent X the only move available is the one to the canonical local
tableau uniLocalTab X defined in Pdl.Interpolation.Uniformity.
The gain is in gameP_general: a winning strategy for Prover yields a tableau with
the property Tableau.IsUni (and hence Tableau.isUniform for the empty history)
because at every loc step the canonical local tableau is used.
Prover and Builder positions #
Equations
- termProver = Lean.ParserDescr.node `termProver 1024 (Lean.ParserDescr.symbol "Prover")
Instances For
Equations
- termBuilder = Lean.ParserDescr.node `termBuilder 1024 (Lean.ParserDescr.symbol "Builder")
Instances For
Equations
- instDecidableEqProverPos.decEq (ProverPos.frep a) (ProverPos.frep b) = ⋯ ▸ isTrue ⋯
- instDecidableEqProverPos.decEq (ProverPos.frep a) (ProverPos.bas a_1 a_2) = isFalse ⋯
- instDecidableEqProverPos.decEq (ProverPos.frep a) (ProverPos.nbas a_1 a_2) = isFalse ⋯
- instDecidableEqProverPos.decEq (ProverPos.bas a a_1) (ProverPos.frep a_2) = isFalse ⋯
- instDecidableEqProverPos.decEq (ProverPos.bas a a_1) (ProverPos.bas b b_1) = ⋯ ▸ have h := ⋯; h ▸ isTrue ⋯
- instDecidableEqProverPos.decEq (ProverPos.bas a a_1) (ProverPos.nbas a_2 a_3) = isFalse ⋯
- instDecidableEqProverPos.decEq (ProverPos.nbas a a_1) (ProverPos.frep a_2) = isFalse ⋯
- instDecidableEqProverPos.decEq (ProverPos.nbas a a_1) (ProverPos.bas a_2 a_3) = isFalse ⋯
- instDecidableEqProverPos.decEq (ProverPos.nbas a a_1) (ProverPos.nbas b b_1) = ⋯ ▸ have h := ⋯; h ▸ isTrue ⋯
Instances For
Builder should make a move.
- lpr {H : History} {X : Sequent} : LoadedPathRepeat H X → BuilderPos H X
- ltab {H : History} {X : Sequent} : ¬flprep H X → ¬X.basic → LocalTableau X → BuilderPos H X
Instances For
Equations
- instDecidableEqBuilderPos.decEq (BuilderPos.lpr a) (BuilderPos.lpr b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- instDecidableEqBuilderPos.decEq (BuilderPos.lpr a) (BuilderPos.ltab a_1 a_2 a_3) = isFalse ⋯
- instDecidableEqBuilderPos.decEq (BuilderPos.ltab a a_1 a_2) (BuilderPos.lpr a_3) = isFalse ⋯
- instDecidableEqBuilderPos.decEq (BuilderPos.ltab a a_1 a_2) (BuilderPos.ltab b b_1 b_2) = ⋯ ▸ have h := ⋯; h ▸ if h : a_2 = b_2 then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Moves #
The relation Move old next says that we can move from old to next.
There are three kinds of moves.
Note that in the prLocTab move Prover has no choice:
the local tableau must be the canonical uniform one, uniLocalTab X.
- prPdl
{X Y : Sequent}
{Hist : History}
{nrep : ¬flprep Hist X}
{Xbasic : X.basic}
: PdlRule X Y → Move ⟨Hist, ⟨X, Sum.inl (ProverPos.bas nrep Xbasic)⟩⟩ ⟨X :: Hist, ⟨Y, posOf (X :: Hist) Y⟩⟩
When the sequent is basic and no repeat, let prover apply a PDL rule.
- prLocTab
{Hist : History}
{X : Sequent}
{nrep : ¬flprep Hist X}
{nbas : ¬X.basic}
: Move ⟨Hist, ⟨X, Sum.inl (ProverPos.nbas nrep nbas)⟩⟩ ⟨Hist, ⟨X, Sum.inr (BuilderPos.ltab nrep nbas (uniLocalTab X))⟩⟩
If not basic, Prover must move to the uniform local tableau
uniLocalTab X. - buEnd
{X : Sequent}
{ltab : LocalTableau X}
{Y : Sequent}
{Hist : History}
{nrep : ¬flprep Hist X}
{nbas : ¬X.basic}
: Y ∈ endNodesOf ltab → Move ⟨Hist, ⟨X, Sum.inr (BuilderPos.ltab nrep nbas ltab)⟩⟩ ⟨X :: Hist, ⟨Y, posOf (X :: Hist) Y⟩⟩
Let Builder pick an end node of
ltab
Instances For
Equations
- (Move.prPdl r).isModal = r.isModal
- Move.prLocTab.isModal = False
- (Move.buEnd a).isModal = False
Instances For
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
- One or more equations did not get rendered due to their size.
- theMoves ⟨H, ⟨X, Sum.inl (ProverPos.frep a)⟩⟩ = ∅
- theMoves ⟨H, ⟨(L, R, some (Sum.inl (~'⌊α;'β⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨(L, R, some (Sum.inl (~'⌊?'τ⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨(L, R, some (Sum.inl (~'⌊α⋓β⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨(L, R, some (Sum.inl (~'⌊∗α⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨(L, R, some (Sum.inr (~'⌊α;'β⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨(L, R, some (Sum.inr (~'⌊?'τ⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨(L, R, some (Sum.inr (~'⌊α⋓β⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨(L, R, some (Sum.inr (~'⌊∗α⌋χ))), Sum.inl (ProverPos.bas a_2 Xbasic_2)⟩⟩ = ⋯.elim
- theMoves ⟨H, ⟨X, Sum.inl (ProverPos.nbas nrep nbas)⟩⟩ = {⟨H, ⟨X, Sum.inr (BuilderPos.ltab nrep nbas (uniLocalTab X))⟩⟩}
- theMoves ⟨H, ⟨X, Sum.inr (BuilderPos.lpr lpr)⟩⟩ = ∅
- theMoves ⟨H, ⟨X, Sum.inr (BuilderPos.ltab a a_1 ltab)⟩⟩ = Finset.image (fun (Y : Sequent) => ⟨X :: H, ⟨Y, posOf (X :: H) Y⟩⟩) (endNodesOf ltab)
Instances For
Characterization of theMoves.
The finite set given by theMoves indeed agrees with the relation move.
Other direction is mem_theMoves_of_move.
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 #
After two moves the history must grow.
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.
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.
Defined using Finset.instMonad.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The following only hold because there we are now working with Finset.
Any Olf is among those generated from its own left and right parts.
This is the key step to show that Sequent.all_subseteq_FL generates all Olf values.
Equations
- Sequent.subseteq_FL_fintype = { elems := X.all_subseteq_FL, complete := ⋯ }
Equations
- X.allSeqt_subseteq_FL = Finset.image (fun (x : { X_1 : Sequent // X_1.subseteq_FL X }) => ↑x) X.all_subseteq_FL
Instances For
New stuff, now about Sequent instead of Seqt #
There are only finitely many FL-subset Sequents for a given Sequent.
This means "there are only finitely many "sequents modulo setEq" that are subseteq_FL Y.
Helper lemma for matchesFinite: If we have enumerate 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 enumeration.
Infinite chains of moves #
Towards matchesFinite we here collect facts about an infinite chain g : ℕ → GamePos with
move (g n) (g (n+1)) for all n, following the proof idea for the matchesFinite lemma:
- at each position of the chain a move is possible, hence there is no forbidden repeat,
i.e.
¬ flprep(seemoveChain_not_flprep); - all sequents along the chain stay inside the FL closure of the first one
(see
moveChain_inside_FL), of which there are only finitely many modulosetEqTo(seeSeqt.subseteq_FL_finite); - the history at a later position contains the sequents of all earlier positions
(see
moveChain_hist_accumandmoveChain_hist_split); - hence a sequent that is
setEqToan earlier one must be loaded, because a free repeat would have ended the match (seemoveChain_setEq_isLoaded), and thus from some point onwards all sequents in the chain are loaded (seemoveChain_eventually_loaded); - a repeat in this loaded part gives a loaded-path repeat, which also ends the match
(see
moveChain_hist_indexandmoveChain_multisetEq_absurd).
This section is from aristotle.harmonic.fun
Helper lemma for matchesFinite: if a property of natural numbers holds arbitrarily late,
then we can enumerate witnesses for it with gaps of at least two.
A sequent in the chain that is setEqTo an earlier one must be loaded,
because otherwise we would have a free repeat and the match would have ended.
If all sequents from N onwards are loaded and N ≤ m with m + 2 ≤ n, then the sequent
of position m occurs in the history of position n at an index such that all entries up to
and including that index are loaded. This is what is needed for a loaded-path repeat.
A setEqTo repeat in the loaded part of the chain is impossible:
it would be a loaded-path repeat, at which the match ends.
Lemma 6.11. The move relation is converse wellfounded (and thus all matches must be finite).
This is similar to the proof that PDL-tableaux are finite (Lemma 4.10), relying on the finiteness
of the Fischer-Ladner closure.
In Lean we never needed to say 4.10 because values of the inductive type Tableau are always
finite by constriction. But we do need a proof here, as this lemma is about move, not Match.
The whole argument is done in the MoveChain section above.
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
This helps to pick up the derived instance DecidableEq GamePos above.
Equations
From Prover winning strategies to tableau #
A game position is uniform if any local tableau in it is the canonical one.
Equations
- GamePos.IsUni ⟨fst, ⟨X, Sum.inr (BuilderPos.ltab a a_1 lt)⟩⟩ = (lt = uniLocalTab X)
- x✝.IsUni = True
Instances For
From Prover winning strategies to uniform tableaux #
After history Hist, if Prover has a winning strategy then there is a closed tableau,
and moreover that tableau is uniform in the sense of Tableau.IsUni, because
Prover has to play the canonical local tableau uniLocalTab.
Note: we skip Definition 6.9 (Strategy Tree for Prover) and just use the Strategy type.
This is the induction loading for gameP.