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.
- instDecidableEqPathIn.decEq PathIn.nil PathIn.nil = isTrue ⋯
- instDecidableEqPathIn.decEq PathIn.nil (PathIn.loc Y_in tail) = isFalse ⋯
- instDecidableEqPathIn.decEq PathIn.nil tail.pdl = isFalse ⋯
- instDecidableEqPathIn.decEq (PathIn.loc Y_in tail) PathIn.nil = isFalse ⋯
- instDecidableEqPathIn.decEq tail.pdl PathIn.nil = isFalse ⋯
- instDecidableEqPathIn.decEq a_8.pdl b.pdl = if h : a_8 = b then h ▸ have inst := 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.
Edge Relation #
Notation ⋖_ for edge (because ⋖ is taken in Mathlib).
Equations
- «term_⋖__» = Lean.ParserDescr.trailingNode `«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 ≠ [].
Equations
- edge_natLT_relHom = { toFun := 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
- 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
- instLTPathIn = { lt := Relation.TransGen edge }
Enable "≤" notation for reflexive transitive closure of ⋖_
Equations
- instLEPathIn = { le := Relation.ReflTransGen edge }
The "<" in a tableau is antisymmetric.
Path cast and append lemmas #
Lemmas developed for tabToIntAt.
From Path to History #
The history of a path has one entry for each step of the path.
Prefix of a path, taking only the first k steps.
Equations
- PathIn.nil.prefix x_2 = PathIn.nil
- tail.pdl.prefix k = Fin.cases PathIn.nil (fun (j : Fin tail.pdl.length) => (tail.prefix j).pdl) k
- (PathIn.loc Y_in tail).prefix k = Fin.cases PathIn.nil (fun (j : Fin (PathIn.loc Y_in tail).length) => 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
- PathIn.nil.rewind x_2 = PathIn.nil
- (PathIn.loc Y_in tail).rewind k = Fin.lastCases PathIn.nil (PathIn.loc Y_in ∘ tail.rewind ∘ Fin.cast ⋯) k
- tail.pdl.rewind k = Fin.lastCases PathIn.nil (PathIn.pdl ∘ tail.rewind ∘ Fin.cast ⋯) k
Instances For
Finiteness and Wellfoundedness #
Equations
- One or more equations did not get rendered due to their size.
- allPaths (Tableau.pdl nflprep bas r next) = {PathIn.nil} ∪ Finset.image (fun (p : PathIn next) => p.pdl) (allPaths next)
- allPaths (Tableau.lrep lpr) = {PathIn.nil}
Instances For
Wellfoundedness of flip edge #
The lemmas and instances here are used for tabToIntAt.
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.
To show lprBounded it suffices to bound all loaded-path repeats reached by paths.