Navigating through tableaux with PathIn #
To define relations between nodes in a tableau we need to represent the whole
tableau and point to a specific node inside it. This is the PathIn type.
Its values say "go to this child, then to this child, ... stop here."
A path in a tableau. Three constructors for the empty path, a local step or a pdl step.
The loc and pdl steps correspond to two out of three constructors of Tableau.
A PathIn only goes downwards, it cannot use LoadedPathRepeats.
- nil {Hist : History} {X : Sequent} {a✝ : Tableau Hist X} : PathIn a✝
- loc {Hist : History} {X : Sequent} {nrep : ¬flprep Hist X} {nbas : ¬X.basic} {lt : LocalTableau X} {next : (Y : Sequent) → Y ∈ endNodesOf lt → Tableau (X :: Hist) Y} {Y : Sequent} (Y_in : Y ∈ endNodesOf lt) (tail : PathIn (next Y Y_in)) : PathIn (Tableau.loc nrep nbas lt next)
- pdl {Hist : History} {X Y : Sequent} {nrep : ¬flprep Hist X} {bas : X.basic} {r : PdlRule X Y} {next : Tableau (X :: Hist) Y} (tail : PathIn next) : PathIn (Tableau.pdl nrep bas r next)
Instances For
Equations
- One or more equations did not get rendered due to their size.
- PDL.instDecidableEqPathIn.decEq PDL.PathIn.nil PDL.PathIn.nil = isTrue ⋯
- PDL.instDecidableEqPathIn.decEq PDL.PathIn.nil (PDL.PathIn.loc Y_in tail) = isFalse ⋯
- PDL.instDecidableEqPathIn.decEq PDL.PathIn.nil tail.pdl = isFalse ⋯
- PDL.instDecidableEqPathIn.decEq (PDL.PathIn.loc Y_in tail) PDL.PathIn.nil = isFalse ⋯
- PDL.instDecidableEqPathIn.decEq tail.pdl PDL.PathIn.nil = isFalse ⋯
- PDL.instDecidableEqPathIn.decEq a_8.pdl b.pdl = if h : a_8 = b then h ▸ have inst := PDL.instDecidableEqPathIn.decEq a_8 a_8; isTrue ⋯ else isFalse ⋯
Instances For
Transporting a path along an equation about tabAt does not change tabAt.
Compare PathIn.tabAt_cast which is about an equation between two tableaux.
Append a path in the reached tableau to an initial path.
Equations
- PDL.PathIn.nil.append q_2 = q_2
- (PDL.PathIn.loc Y_in tail).append q_2 = PDL.PathIn.loc Y_in (tail.append q_2)
- tail.pdl.append q_2 = (tail.append q_2).pdl
Instances For
The length of a path is the number of actual steps.
Equations
Instances For
Edge Relation #
Notation ⋖_ for edge (because ⋖ is taken in Mathlib).
Equations
- PDL.«term_⋖__» = Lean.ParserDescr.trailingNode `PDL.«term_⋖__» 1022 1023 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⋖_ ") (Lean.ParserDescr.cat `term 1023))
Instances For
Appending a one-step loc path is also a ⋖_ child.
When using this, this may be helpful:
convert this; rw [← heq_iff_eq, heq_eqRec_iff_heq, eqRec_heq_iff_heq].
Appending a one-step pdl path is also a ⋖_ child.
Variant of edge_append_pdl_nil where the assumption is about all of tabAt s,
analogous to edge_append_loc_nil.
The root has no parent. Note this holds even when Hist ≠ [].
Map tableau edges to strict increases in path length.
Equations
- PDL.edgeNatLTRelHom = { toFun := PDL.PathIn.length, map_rel' := ⋯ }
Instances For
The ⋖_ relation in a tableau is well-founded.
Proven by lifting the relation to the length of histories.
That length goes up with ⋖_, so because < is wellfounded on Nat
also ⋖_ is well-founded via RelHomClass.wellFounded.
Equations
- PDL.instDecidableEdge p q = decidable_of_iff (q ∈ Finset.image Subtype.val p.children) ⋯
An induction principle for PathIn with a base case at the root of the tableau and
an induction step using the edge relation ⋖_.
QUESTIONS:
- Do we need to add any of these attributes? @[induction_eliminator, elab_as_elim]
- Should it be a def or a theorem? (
motivetoPropor toSort u?)
Transitive Closure of the Edge Relation #
Enable "<" notation for transitive closure of ⋖_.
Equations
- PDL.instLTPathIn = { lt := Relation.TransGen PDL.edge }
Enable "≤" notation for reflexive transitive closure of ⋖_
Equations
The "<" in a tableau is antisymmetric.
Path cast and append lemmas #
Lemmas developed for tabToIntAt.
From Path to History #
Prefix of a path, taking only the first k steps.
Equations
- PDL.PathIn.nil.prefix x_2 = PDL.PathIn.nil
- tail.pdl.prefix k = Fin.cases PDL.PathIn.nil (fun (j : Fin tail.pdl.length) => (tail.prefix j).pdl) k
- (PDL.PathIn.loc Y_in tail).prefix k = Fin.cases PDL.PathIn.nil (fun (j : Fin (PDL.PathIn.loc Y_in tail).length) => PDL.PathIn.loc Y_in (tail.prefix j)) k
Instances For
Path Rewinding #
Rewinding a path, removing the last k steps. Cannot go into Hist.
Used to go to the companion of a repeat. Returns .nil when k is the length of the whole path.
We use +1 in the type because rewind 0 is always possible, even with history [].
Defined using Fin.lastCases.
Hint: when proving stuff about rewind k, avoid induction on k, because rewind does not decrease k.
Equations
- PDL.PathIn.nil.rewind x_2 = PDL.PathIn.nil
- (PDL.PathIn.loc Y_in tail).rewind k = Fin.lastCases PDL.PathIn.nil (PDL.PathIn.loc Y_in ∘ tail.rewind ∘ Fin.cast ⋯) k
- tail.pdl.rewind k = Fin.lastCases PDL.PathIn.nil (PDL.PathIn.pdl ∘ tail.rewind ∘ Fin.cast ⋯) k
Instances For
Finiteness and Wellfoundedness #
Enumerate every path in a tableau.
Equations
- One or more equations did not get rendered due to their size.
- PDL.allPaths (PDL.Tableau.pdl nflprep bas r next) = {PDL.PathIn.nil} ∪ Finset.image (fun (p : PDL.PathIn next) => p.pdl) (PDL.allPaths next)
- PDL.allPaths (PDL.Tableau.lrep lpr) = {PDL.PathIn.nil}
Instances For
A Tableau is finite.
Should be useful to get converse well-foundedness of edge
Equations
- PDL.PathIn.instFintype = { elems := PDL.allPaths tab, complete := ⋯ }
Induction principle going from the leaves (= childless nodes) to the root.
Suppose whenever the motive holds at all children then it holds at the parent.
Then it holds at all nodes.
Strong induction from the leaves (= childless nodes) to the root.
Suppose whenever the motive holds at all successors then it holds at the parent.
Then it holds at all nodes.