Documentation

LeanPool.Lean4GlCoalgebras.Interpolation.Interpolants

Finding interpolants #

Here we show that given a finite GL-split proof, we can always find suitable interpolants.

Get the entire underlying sequent of a finite proof.

Equations
Instances For
    def Lean4GlCoalgebras.Split.Proof.freeVar (𝕏 : Proof) [fin_X : Fintype 𝕏.X] :

    Find n such that for all m β‰₯ n, m is not in an the variables of the proof.

    Equations
    Instances For
      theorem Lean4GlCoalgebras.at_in_lt_freeVar {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {n : β„•} (h : at n ∈ 𝕏.Sequent) :
      n < 𝕏.freeVar
      noncomputable def Lean4GlCoalgebras.encodeVar {𝕏 : Split.Proof} [Fintype 𝕏.X] :
      𝕏.X β†’ β„•

      For each x in a finite proof, find a free variable.

      Equations
      Instances For
        noncomputable def Lean4GlCoalgebras.unencodeVar {𝕏 : Split.Proof} [Fintype 𝕏.X] (n : β„•) (h1 : n - 𝕏.freeVar < Fintype.card 𝕏.X) :
        𝕏.X

        Given n in the range of the free variables, unencode it back to its proof node.

        Equations
        Instances For

          The encodeVar function is injective.

          @[simp]
          theorem Lean4GlCoalgebras.encodeVar_inj' (𝕏 : Split.Proof) [Fintype 𝕏.X] (x y : 𝕏.X) :

          The encodeVar function is injective. This version works better with simp than encodeVar_inj.

          theorem Lean4GlCoalgebras.encodeVar_inv (𝕏 : Split.Proof) [Fintype 𝕏.X] (x : 𝕏.X) :
          unencodeVar (encodeVar x) β‹― = x

          unencodeVar is a left inverse of encodeVar.

          theorem Lean4GlCoalgebras.unencodeVar_inv (𝕏 : Split.Proof) [Fintype 𝕏.X] (n : β„•) (h1 : n - 𝕏.freeVar < Fintype.card 𝕏.X) (h2 : n β‰₯ 𝕏.freeVar) :

          encodeVar is a left inverse of unencodeVar.

          theorem Lean4GlCoalgebras.at_in_not_encodeVar {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {n : β„•} (h : at n ∈ 𝕏.Sequent) (x : 𝕏.X) :
          theorem Lean4GlCoalgebras.encodeVar_eq {𝕏 : Split.Proof} {Fin_X : Fintype 𝕏.X} {x : 𝕏.X} {n : β„•} {h1 : n - 𝕏.freeVar < Fintype.card 𝕏.X} {h2 : n β‰₯ 𝕏.freeVar} :
          noncomputable def Lean4GlCoalgebras.equation {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] (x : 𝕏.X) :

          Auxiliary declaration used in the GL coalgebra development.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Lean4GlCoalgebras.encodeVar_helper₁ {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {Y : Finset 𝕏.X} {n : β„•} (h : n ∈ Finset.image encodeVar Y) :
            n - 𝕏.freeVar < Fintype.card 𝕏.X
            theorem Lean4GlCoalgebras.encodeVar_helperβ‚‚ {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {Y : Finset 𝕏.X} {n : β„•} (h : n ∈ Finset.image encodeVar Y) :
            unencodeVar n β‹― ∈ Y
            noncomputable def Lean4GlCoalgebras.extend {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {Y : Finset 𝕏.X} (Y_sub : Y βŠ† Fintype.elems) (Οƒ : β†₯Y β†’ Formula) :

            Extend a substitution specific to encoded variables to all formulas.

            Equations
            Instances For
              theorem Lean4GlCoalgebras.partial_const {p : β„• β†’ Prop} [DecidablePred p] (Οƒ : Subtype p β†’ Formula) (A : Formula) :
              (βˆ€ n ∈ A.vocab, Β¬p n) β†’ A = partial_ Οƒ A
              @[simp]
              theorem Lean4GlCoalgebras.Finset.doubleton_subset_iff {Ξ± : Type} [DecidableEq Ξ±] {s : Finset Ξ±} {a b : Ξ±} :
              theorem Lean4GlCoalgebras.extend_in {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {Y : Finset 𝕏.X} (Y_sub : Y βŠ† Fintype.elems) (Οƒ : β†₯Y β†’ Formula) (A : Formula) :
              (βˆ€ y ∈ Y, encodeVar y βˆ‰ A.vocab) β†’ A = extend Y_sub Οƒ A
              theorem Lean4GlCoalgebras.encodeVar_in_equation_imp_edge {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {x y : 𝕏.X} :
              encodeVar y ∈ (equation x).vocab β†’ Split.edge 𝕏.Ξ± x y

              From the paper: If py ∈ Ο‡x then x ◁ y.

              theorem Lean4GlCoalgebras.var_in_equation {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {x : 𝕏.X} (n : β„•) :
              n ∈ (equation x).vocab β†’ n ∈ (Split.f (Split.r 𝕏.Ξ± x)).left.vocab ∩ (Split.f (Split.r 𝕏.Ξ± x)).right.vocab ∨ βˆƒ (y : 𝕏.X), encodeVar y = n ∧ Split.edge 𝕏.Ξ± x y

              From the paper: If p ∈ Ο‡x then p ∈ Voc(fΛ‘(x)) ∩ Voc(fΚ³(x)) or p = py and x ◁ y.

              theorem Lean4GlCoalgebras.interpolant_strong_helper {p : β„• β†’ Prop} [DecidablePred p] (Οƒ : Subtype p β†’ Formula) (n : β„•) {B A : Formula} :
              single n B (partial_ Οƒ A) = partial_ (fun (m : { m : β„• // p m ∨ m = n }) => single n B (if h : p ↑m then Οƒ βŸ¨β†‘m, h⟩ else at↑m)) A

              Helper for Solution strong, gives interaction between single substitution and partial substitution.

              @[irreducible]
              noncomputable def Lean4GlCoalgebras.interpolantStrong {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] {Y : Finset 𝕏.X} (Y_sub : Y βŠ† Fintype.elems) :
              β†₯(Finset.image encodeVar Y) β†’ Formula

              Strong solution towards finding interpolants.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Lean4GlCoalgebras.interpolant_strong_prop {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] (Y : Finset 𝕏.X) (Y_sub : Y βŠ† Fintype.elems) (n : β†₯(Finset.image encodeVar Y)) :
                (interpolantStrong Y_sub n = partial_ (interpolantStrong Y_sub) (equation (unencodeVar ↑n β‹―)) ∨ (interpolantStrong Y_sub nβ‰…partial_ (interpolantStrong Y_sub) (equation (unencodeVar ↑n β‹―)))) ∧ (βˆ€ m ∈ (interpolantStrong Y_sub n).vocab, m ∈ (Split.f (Split.r 𝕏.Ξ± (unencodeVar ↑n β‹―))).left.vocab ∩ (Split.f (Split.r 𝕏.Ξ± (unencodeVar ↑n β‹―))).right.vocab βˆͺ Finset.image encodeVar Fintype.elems \ Finset.image encodeVar Y) ∧ βˆ€ (y : 𝕏.X), encodeVar y ∈ (partial_ (interpolantStrong Y_sub) (at↑n)).vocab β†’ Relation.ReflTransGen (Split.edge 𝕏.Ξ±) (unencodeVar ↑n β‹―) y

                Proves that interpolantStrong satisfies the necessary properties.

                noncomputable def Lean4GlCoalgebras.interpolant (𝕏 : Split.Proof) [fin_X : Fintype 𝕏.X] :

                Auxiliary declaration used in the GL coalgebra development.

                Equations
                Instances For
                  theorem Lean4GlCoalgebras.interpolant_prop {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] (x : 𝕏.X) :