Imports
module public import Pdl.Bisimulation public import Pdl.Discon public import Pdl.Interpolation.Statement public import PdlTestFree.Paths
@[expose] public section-- Verso syntax (instead of Markdown) for `$$` math below. set_option doc.verso.module true-- Suggestions are off because they fire on every code span. set_option doc.verso.suggestions false

Test-free PDL does not have Craig interpolation

This file gives a valid implication between test-free PDL formulas that has no test-free interpolant. The statement is purely semantic: it does not depend on the tableau system or on the method used to construct interpolants elsewhere in this project.

Write p, q, s for the proposition letters ·0, ·1, ·2 and a for the atomic program ·0, and let

  • Γ₁ = { s, [a*]((p ∧ s) → (⟨a⟩⊤ ∧ [a]s)) }

  • Γ₂ = { [a*](q → p), [a*](⟨a⟩q → q), ⟨a*⟩(q ∧ [a]⊥) }

Both sets are test-free. The common vocabulary is {a, p}; the s occurs only in Γ₁, the q only in Γ₂.

Γ₁ ∪ Γ₂ is unsatisfiable (gammaOne_gammaTwo_unsat), i.e. ⋀Γ₁ → ¬⋀Γ₂ is valid: the last formula of Γ₂ gives a path to a q-state without successors; by [a*](⟨a⟩q → q) every state on that path is a q-state, and by [a*](q → p) also a p-state. By induction along the path, using s at the start and p ∧ s → ⟨a⟩⊤ ∧ [a]s from Γ₁, every state on the path satisfies s; so the last state satisfies p ∧ s and must have a successor, which it does not.

After projecting away the private letters, Γ₁ says "along every a-path, as long as p has held there is a further a-step" (no all-p path ends in a dead end) and Γ₂ says "some all-p path ends in a dead end". An interpolant has to separate these two "until"-like properties, which needs a test: [(p?;a)*](p → ⟨a⟩⊤) is an interpolant (withTest_Interpolant), but no test-free formula is. We make this precise with a single Kripke model MG and two of its states m and v j such that

  • (MG, m) ⊨ Γ₁ (gammaOne_at_m),

  • (MG, v j) ⊨ Γ₂ for every j (gammaTwo_at_v),

  • m and v j satisfy the same test-free formulas over {a, p} of modal depth ≤ j (depth_equiv).

Hence no test-free formula θ over {a, p} satisfies Γ₁ ⊨ θ and Γ₂ ⊨ ¬θ (no_interpolant). Three letters are the minimum for this kind of example: a side without private vocabulary is, up to negation, itself an interpolant.

The model MG

(A picture of the model can be found in the paper.)

MG has the states u, m, w i and v i for i : ℕ. The only atomic program with a nonempty relation is a; its relation R is

  • u → x for every state x off the chain, that is, for every x other than the v i,

  • m → u, m → m,

  • w (i+1) → u, w i and v (i+1) → u, v i,

  • w 0 and v 0 have no successors.

Valuation: p at m, at every w i and at every v i; s at m and u; q at every v i (nothing else at u).

The chain v j → v (j-1) → … → v 0 is an all-p path to the dead end v 0, and no edge leads from a state off the chain into it, so q := {v i} satisfies Γ₂ at v j. The states off the chain are therefore exactly those reachable from m, and there, with s := {m, u}, Γ₁ holds at m.

Why m and v j agree on test-free formulas of depth ≤ j

With a single atomic program, a test-free program α relates w to v iff for some n such that α can be executed by exactly n actual steps (L α n), there is a path of exactly n steps from w to v (relate_iff). So [α]ψ at w quantifies over the states reachable in exactly n steps, for those n (box_iff). These sets are

\begin{array}{llll} n & \text{from } m & \text{from } v_k \\ \hline 0 & \{ m \} & \{ v_k \} \\ 1 & \{ m, u \} & \{ u, v_{k-1} \} \\ 2 \ldots k & \{ m, u \} \cup \text{all $w_i$} & \{ m, u, v_{k-n} \} \cup \text{all $w_i$} \\ k+1 \ldots & \{ m, u \} \cup \text{all $w_i$} & \{ m, u \} \cup \text{all $w_i$} \\ \end{array}

since u reaches every state off the chain in every number ≥ 1 of steps, while v 0 reaches nothing. The relation Z relating every state to itself and moreover w i to v i is a bisimulation of MG with itself for the vocabulary {a, p} (Z_isBisim), and bisimilar states satisfy the same formulas over that vocabulary (IsBisim.evaluate from Pdl.Bisimulation, which does allow tests). Hence, by induction on ψ with mdepth ψ + 1 ≤ j (so j ≥ 1), in each row the witnesses on both sides are matched: the states off the chain occur on both sides, the chain states v j and v (j-1) are equivalent to m by the induction hypothesis, and v (j-n) (for n ≥ 2) is equivalent to w (j-n) by Z, which is reachable from m in the same number of steps. So [α]ψ has the same truth value at m and at v j.

The depth bound is sharp: the test-free formula ⟨a⟩(p ∧ ⟨a⟩(p ∧ … ⟨a⟩(p ∧ [a]⊥))) with j nested diamonds has depth j+1, is true at v j, and is false at m. The test-freeness cannot be dropped either: [(p?;a)*](p → ⟨a⟩⊤) is false at every v j and true at m.

namespace TestfreeNoItpopen HasSat vDash

The two sets of formulas

abbrev p : Formula := ·0abbrev q : Formula := ·1abbrev s : Formula := ·2abbrev a : Program := ·0

The body of the left star formula: (p ∧ s) → (⟨a⟩⊤ ∧ [a]s). (A def, not an abbrev, so that simp only [evaluate] leaves it alone.)

def body : Formula := (p ⋀ s) ↣ ((~(⌈a⌉⊥)) ⋀ ⌈a⌉s)

Γ₁ = { s, [a*]((p ∧ s) → (⟨a⟩⊤ ∧ [a]s)) }

def gammaOne : List Formula := [s, ⌈∗a⌉body]

Γ₂ = { [a*](q → p), [a*](⟨a⟩q → q), ⟨a*⟩(q ∧ [a]⊥) }

def gammaTwo : List Formula := [⌈∗a⌉(q ↣ p), ⌈∗a⌉((~⌈a⌉~q) ↣ q), ~⌈∗a⌉~(q ⋀ ⌈a⌉⊥)]
lemma gammaOne_testFree : ∀ φ ∈ gammaOne, φ.testFree := ⊢ ∀ φ ∈ gammaOne, φ.testFree All goals completed! 🐙lemma gammaTwo_testFree : ∀ φ ∈ gammaTwo, φ.testFree := ⊢ ∀ φ ∈ gammaTwo, φ.testFree All goals completed! 🐙

The implication is valid

Γ₁ at w, unfolded: s holds at w, and every a*-reachable p ∧ s-state has an a-successor and all its a-successors satisfy s.

lemma gammaOne_iff {W : Type} (M : KripkeModel W) (w : W) : (∀ φ ∈ gammaOne, evaluate M w φ) ↔ M.val w 2 ∧ ∀ v, Relation.ReflTransGen (M.Rel 0) w v → M.val v 0 → M.val v 2 → (∃ u, M.Rel 0 v u) ∧ ∀ u, M.Rel 0 v u → M.val u 2 := W:TypeM:KripkeModel Ww:W⊢ (∀ φ ∈ gammaOne, evaluate M w φ) ↔ M.val w 2 ∧ ∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 0 → M.val v 2 → (∃ u, M.Rel 0 v u) ∧ ∀ (u : W), M.Rel 0 v u → M.val u 2 All goals completed! 🐙

Γ₂ at w, unfolded: every a*-reachable q-state is a p-state, every a*-reachable state with a q-successor is a q-state, and some a*-reachable q-state has no a-successor.

lemma gammaTwo_iff {W : Type} (M : KripkeModel W) (w : W) : (∀ φ ∈ gammaTwo, evaluate M w φ) ↔ (∀ v, Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0) ∧ (∀ v, Relation.ReflTransGen (M.Rel 0) w v → ∀ u, M.Rel 0 v u → M.val u 1 → M.val v 1) ∧ (∃ v, Relation.ReflTransGen (M.Rel 0) w v ∧ M.val v 1 ∧ ∀ u, ¬ M.Rel 0 v u) := W:TypeM:KripkeModel Ww:W⊢ (∀ φ ∈ gammaTwo, evaluate M w φ) ↔ (∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0) ∧ (∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → ∀ (u : W), M.Rel 0 v u → M.val u 1 → M.val v 1) ∧ ∃ v, Relation.ReflTransGen (M.Rel 0) w v ∧ M.val v 1 ∧ ∀ (u : W), ¬M.Rel 0 v u All goals completed! 🐙

By Γ₂, any a*-reachable q-state is reached along p ∧ q-states.

lemma gammaTwo_path {W : Type} {M : KripkeModel W} {w : W} (h2 : ∀ φ ∈ gammaTwo, evaluate M w φ) {v : W} (hv : Relation.ReflTransGen (M.Rel 0) w v) (hq : M.val v 1) : Relation.ReflTransGen (fun x y => M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w v := W:TypeM:KripkeModel Ww:Wh2:∀ φ ∈ gammaTwo, evaluate M w φv:Whv:Relation.ReflTransGen (M.Rel 0) w vhq:M.val v 1⊢ Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w v W:TypeM:KripkeModel Ww:Wh2:∀ φ ∈ gammaTwo, evaluate M w φv:Whv:Relation.ReflTransGen (M.Rel 0) w vhq:M.val v 1hqp:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0hcl:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → ∀ (u : W), M.Rel 0 v u → M.val u 1 → M.val v 1⊢ Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w v induction hv with W:TypeM:KripkeModel Ww:Wh2:∀ φ ∈ gammaTwo, evaluate M w φv:Whqp:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0hcl:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → ∀ (u : W), M.Rel 0 v u → M.val u 1 → M.val v 1hq:M.val w 1⊢ Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w w All goals completed! 🐙 W:TypeM:KripkeModel Ww:Wh2:∀ φ ∈ gammaTwo, evaluate M w φv✝:Whqp:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0hcl:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → ∀ (u : W), M.Rel 0 v u → M.val u 1 → M.val v 1v:Wu:Whwv:Relation.ReflTransGen (M.Rel 0) w vhvu:M.Rel 0 v uIH:M.val v 1 → Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w vhq:M.val u 1⊢ Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w u W:TypeM:KripkeModel Ww:Wh2:∀ φ ∈ gammaTwo, evaluate M w φv✝:Whqp:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0hcl:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → ∀ (u : W), M.Rel 0 v u → M.val u 1 → M.val v 1v:Wu:Whwv:Relation.ReflTransGen (M.Rel 0) w vhvu:M.Rel 0 v uIH:M.val v 1 → Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w vhq:M.val u 1hqv:M.val v 1⊢ Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w u All goals completed! 🐙

Γ₁ ∪ Γ₂ is not satisfiable.

theorem gammaOne_gammaTwo_unsat : ¬ satisfiable (gammaOne ++ gammaTwo) := ⊢ ¬satisfiable (gammaOne ++ gammaTwo) W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φ⊢ False W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φ⊢ False W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φh2:∀ φ ∈ gammaTwo, evaluate M w φ⊢ False W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φh2:∀ φ ∈ gammaTwo, evaluate M w φhs:M.val w 2hbody:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 0 → M.val v 2 → (∃ u, M.Rel 0 v u) ∧ ∀ (u : W), M.Rel 0 v u → M.val u 2⊢ False W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φh2:∀ φ ∈ gammaTwo, evaluate M w φhs:M.val w 2hbody:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 0 → M.val v 2 → (∃ u, M.Rel 0 v u) ∧ ∀ (u : W), M.Rel 0 v u → M.val u 2hqp:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0v:Whv:Relation.ReflTransGen (M.Rel 0) w vhqv:M.val v 1hdead:∀ (u : W), ¬M.Rel 0 v u⊢ False -- by `Γ₂` the path to `v` consists of `p ∧ q`-states, so by `Γ₁` all of them satisfy `s` W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φh2:∀ φ ∈ gammaTwo, evaluate M w φhs:M.val w 2hbody:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 0 → M.val v 2 → (∃ u, M.Rel 0 v u) ∧ ∀ (u : W), M.Rel 0 v u → M.val u 2hqp:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0v:Whv:Relation.ReflTransGen (M.Rel 0) w vhqv:M.val v 1hdead:∀ (u : W), ¬M.Rel 0 v uhsv:M.val v 2⊢ False -- so `v` satisfies `p ∧ s` and must have a successor, but it has none W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φh2:∀ φ ∈ gammaTwo, evaluate M w φhs:M.val w 2hbody:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 0 → M.val v 2 → (∃ u, M.Rel 0 v u) ∧ ∀ (u : W), M.Rel 0 v u → M.val u 2hqp:∀ (v : W), Relation.ReflTransGen (M.Rel 0) w v → M.val v 1 → M.val v 0v:Whv:Relation.ReflTransGen (M.Rel 0) w vhqv:M.val v 1hdead:∀ (u : W), ¬M.Rel 0 v uhsv:M.val v 2u:Whu:M.Rel 0 v u⊢ False All goals completed! 🐙

Thus ⋀Γ₁ → ¬⋀Γ₂ is valid.

theorem gammaOne_gammaTwo_taut : tautology (con gammaOne ↣ ~con gammaTwo) := ⊢ tautology (~(con gammaOne ⋀ ~~con gammaTwo)) W:TypeM:KripkeModel Ww:W⊢ evaluate M w (~(con gammaOne ⋀ ~~con gammaTwo)) W:TypeM:KripkeModel Ww:W⊢ (∀ f ∈ gammaOne, evaluate M w f) → ¬∀ f ∈ gammaTwo, evaluate M w f W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w f⊢ False W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne ++ gammaTwo⊢ evaluate M w φ W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne ∨ φ ∈ gammaTwo⊢ evaluate M w φ W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne⊢ evaluate M w φW:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaTwo⊢ evaluate M w φ W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne⊢ evaluate M w φ All goals completed! 🐙 W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaTwo⊢ evaluate M w φ All goals completed! 🐙

The model MG

States of MG: the states u, m and w i off the q-chain, and the chain v i.

inductive St : Type | u : St | m : St | w : ℕ → St | v : ℕ → St deriving DecidableEq
open St

Valuation of MG. Letters: p = 0, q = 1, s = 2.

def val : St → ℕ → Prop | u, n => n = 2 | m, n => n = 0 ∨ n = 2 | w _, n => n = 0 | v _, n => n = 0 ∨ n = 1

The relation of a in MG: u sees every state off the chain, m sees u and itself, and the two chains lead down to their dead ends w 0 and v 0.

def R : St → St → Prop | u, v _ => False | u, _ => True | m, y => y = u ∨ y = m | w (i + 1), y => y = u ∨ y = w i | w 0, _ => False | v (i + 1), y => y = u ∨ y = v i | v 0, _ => False

The model MG: the atomic program a = ·0 has the relation R, all other atomic programs have the empty relation.

def MG : KripkeModel St := ⟨val, fun | 0 => R | _ + 1 => fun _ _ => False⟩
@[simp] lemma MG_val (x : St) (n : ℕ) : MG.val x n ↔ val x n := Iff.rfl@[simp] lemma MG_Rel_zero : MG.Rel 0 = R := rfl

The states off the q-chain

No edge leads from u, m or a w i into the chain, so these are exactly the states reachable from m, and they form the part of MG where Γ₁ holds.

The states off the q-chain: u, m and the w i.

@[simp] def offChain : St → Prop | v _ => False | _ => True
lemma R_u {y : St} (hy : offChain y) : R u y := y:Sthy:offChain y⊢ R u y hy:offChain u⊢ R u uhy:offChain m⊢ R u ma✝:ℕhy:offChain (w a✝)⊢ R u (w a✝)a✝:ℕhy:offChain (v a✝)⊢ R u (v a✝) hy:offChain u⊢ R u uhy:offChain m⊢ R u ma✝:ℕhy:offChain (w a✝)⊢ R u (w a✝)a✝:ℕhy:offChain (v a✝)⊢ R u (v a✝) All goals completed! 🐙lemma offChain_R {x y : St} (hx : offChain x) (h : R x y) : offChain y := x:Sty:Sthx:offChain xh:R x y⊢ offChain y cases x with y:Sthx:offChain uh:R u y⊢ offChain y hx:offChain uh:R u u⊢ offChain uhx:offChain uh:R u m⊢ offChain mhx:offChain ua✝:ℕh:R u (w a✝)⊢ offChain (w a✝)hx:offChain ua✝:ℕh:R u (v a✝)⊢ offChain (v a✝) hx:offChain uh:R u u⊢ offChain uhx:offChain uh:R u m⊢ offChain mhx:offChain ua✝:ℕh:R u (w a✝)⊢ offChain (w a✝)hx:offChain ua✝:ℕh:R u (v a✝)⊢ offChain (v a✝) All goals completed! 🐙 y:Sthx:offChain mh:R m y⊢ offChain y hx:offChain m⊢ offChain uhx:offChain m⊢ offChain m hx:offChain m⊢ offChain uhx:offChain m⊢ offChain m All goals completed! 🐙 y:Sti:ℕhx:offChain (w i)h:R (w i) y⊢ offChain y cases i with y:Sthx:offChain (w 0)h:R (w 0) y⊢ offChain y All goals completed! 🐙 y:Sti:ℕhx:offChain (w (i + 1))h:R (w (i + 1)) y⊢ offChain y i:ℕhx:offChain (w (i + 1))⊢ offChain ui:ℕhx:offChain (w (i + 1))⊢ offChain (w i) i:ℕhx:offChain (w (i + 1))⊢ offChain ui:ℕhx:offChain (w (i + 1))⊢ offChain (w i) All goals completed! 🐙 y:Sti:ℕhx:offChain (v i)h:R (v i) y⊢ offChain y All goals completed! 🐙lemma NStep_offChain {n : ℕ} {x y : St} (hx : offChain x) (h : NStep R n x y) : offChain y := n:ℕx:Sty:Sthx:offChain xh:NStep R n x y⊢ offChain y induction n generalizing x with y:Stx:Sthx:offChain xh:NStep R 0 x y⊢ offChain y y:Stx:Sthx:offChain xh:x = y⊢ offChain y; x:Sthx:offChain x⊢ offChain x; All goals completed! 🐙 y:Stn:ℕIH:∀ {x : St}, offChain x → NStep R n x y → offChain yx:Sthx:offChain xh:NStep R (n + 1) x y⊢ offChain y y:Stn:ℕIH:∀ {x : St}, offChain x → NStep R n x y → offChain yx:Sthx:offChain xz:Sthz:R x zhzy:NStep R n z y⊢ offChain y; All goals completed! 🐙

Reachability in M

From u, every state off the chain is reached in any number n ≥ 1 of steps.

lemma u_NStep (y : St) (hy : offChain y) : ∀ n, 1 ≤ n → NStep R n u y := y:Sthy:offChain y⊢ ∀ (n : ℕ), 1 ≤ n → NStep R n u y y:Sthy:offChain yn:ℕhn:1 ≤ n⊢ NStep R n u y induction n with y:Sthy:offChain yhn:1 ≤ 0⊢ NStep R 0 u y All goals completed! 🐙 y:Sthy:offChain yn:ℕIH:1 ≤ n → NStep R n u yhn:1 ≤ n + 1⊢ NStep R (n + 1) u y cases n with y:Sthy:offChain yIH:1 ≤ 0 → NStep R 0 u yhn:1 ≤ 0 + 1⊢ NStep R (0 + 1) u y All goals completed! 🐙 y:Sthy:offChain yn:ℕIH:1 ≤ n + 1 → NStep R (n + 1) u yhn:1 ≤ n + 1 + 1⊢ NStep R (n + 1 + 1) u y exact ⟨u, R_u (y:Sthy:offChain yn:ℕIH:1 ≤ n + 1 → NStep R (n + 1) u yhn:1 ≤ n + 1 + 1⊢ offChain u All goals completed! 🐙), IH (y:Sthy:offChain yn:ℕIH:1 ≤ n + 1 → NStep R (n + 1) u yhn:1 ≤ n + 1 + 1⊢ 1 ≤ n + 1 All goals completed! 🐙)⟩

From m, every state off the chain is reached in any number n ≥ 2 of steps.

lemma m_NStep (y : St) (hy : offChain y) {n : ℕ} (hn : 2 ≤ n) : NStep R n m y := y:Sthy:offChain yn:ℕhn:2 ≤ n⊢ NStep R n m y y:Sthy:offChain yk:ℕhn:2 ≤ k + 1⊢ NStep R (k + 1) m y exact ⟨u, Or.inl rfl, u_NStep y hy k (y:Sthy:offChain yk:ℕhn:2 ≤ k + 1⊢ 1 ≤ k All goals completed! 🐙)⟩
lemma NStep_one_m {y : St} : NStep R 1 m y ↔ y = u ∨ y = m := y:St⊢ NStep R 1 m y ↔ y = u ∨ y = m y:St⊢ (∃ u, R m u ∧ u = y) ↔ y = u ∨ y = m y:St⊢ (∃ u, R m u ∧ u = y) → y = u ∨ y = my:St⊢ y = u ∨ y = m → ∃ u, R m u ∧ u = y y:St⊢ (∃ u, R m u ∧ u = y) → y = u ∨ y = m z:Sth:R m z⊢ z = u ∨ z = m; All goals completed! 🐙 y:St⊢ y = u ∨ y = m → ∃ u, R m u ∧ u = y y:Sth:y = u ∨ y = m⊢ ∃ u, R m u ∧ u = y; All goals completed! 🐙

From v j with j ≥ 1, every state off the chain is reached in any number n ≥ 2 of steps.

lemma v_NStep (y : St) (hy : offChain y) {j n : ℕ} (hj : 1 ≤ j) (hn : 2 ≤ n) : NStep R n (v j) y := y:Sthy:offChain yj:ℕn:ℕhj:1 ≤ jhn:2 ≤ n⊢ NStep R n (v j) y y:Sthy:offChain yj:ℕhj:1 ≤ jk:ℕhn:2 ≤ k + 1⊢ NStep R (k + 1) (v j) y y:Sthy:offChain yk:ℕhn:2 ≤ k + 1i:ℕhj:1 ≤ i + 1⊢ NStep R (k + 1) (v (i + 1)) y exact ⟨u, Or.inl rfl, u_NStep y hy k (y:Sthy:offChain yk:ℕhn:2 ≤ k + 1i:ℕhj:1 ≤ i + 1⊢ 1 ≤ k All goals completed! 🐙)⟩

A state off the chain reached from v j in n steps is also reached from m in n steps.

lemma NStep_m_of_v {n j : ℕ} {y : St} (hy : offChain y) (h : NStep R n (v j) y) : NStep R n m y := n:ℕj:ℕy:Sthy:offChain yh:NStep R n (v j) y⊢ NStep R n m y j:ℕy:Sthy:offChain yh:NStep R 0 (v j) y⊢ NStep R 0 m yj:ℕy:Sthy:offChain yh:NStep R (0 + 1) (v j) y⊢ NStep R (0 + 1) m yj:ℕy:Sthy:offChain yn:ℕh:NStep R (n + 1 + 1) (v j) y⊢ NStep R (n + 1 + 1) m y j:ℕy:Sthy:offChain yh:NStep R 0 (v j) y⊢ NStep R 0 m y j:ℕy:Sthy:offChain yh:v j = y⊢ NStep R 0 m y; j:ℕhy:offChain (v j)⊢ NStep R 0 m (v j); All goals completed! 🐙 j:ℕy:Sthy:offChain yh:NStep R (0 + 1) (v j) y⊢ NStep R (0 + 1) m y j:ℕy:Sthy:offChain yz:Sthz:R (v j) zhzy:NStep R 0 z y⊢ NStep R (0 + 1) m y j:ℕy:Sthy:offChain yz:Sthz:R (v j) zhzy:z = y⊢ NStep R (0 + 1) m y j:ℕz:Sthz:R (v j) zhy:offChain z⊢ NStep R (0 + 1) m z j:ℕz:Sthz:R (v j) zhy:offChain z⊢ z = u ∨ z = m cases j with z:Sthy:offChain zhz:R (v 0) z⊢ z = u ∨ z = m All goals completed! 🐙 z:Sthy:offChain zj:ℕhz:R (v (j + 1)) z⊢ z = u ∨ z = m j:ℕhy:offChain u⊢ u = u ∨ u = mj:ℕhy:offChain (v j)⊢ v j = u ∨ v j = m j:ℕhy:offChain u⊢ u = u ∨ u = m All goals completed! 🐙 j:ℕhy:offChain (v j)⊢ v j = u ∨ v j = m All goals completed! 🐙 j:ℕy:Sthy:offChain yn:ℕh:NStep R (n + 1 + 1) (v j) y⊢ NStep R (n + 1 + 1) m y exact m_NStep y hy (j:ℕy:Sthy:offChain yn:ℕh:NStep R (n + 1 + 1) (v j) y⊢ 2 ≤ n + 1 + 1 All goals completed! 🐙)

A state on the chain reached from v j in n steps is v (j - n), with n ≤ j.

lemma NStep_v_chain {n : ℕ} : ∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - n := n:ℕ⊢ ∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - n induction n with ⊢ ∀ {j i : ℕ}, NStep R 0 (v j) (v i) → 0 ≤ j ∧ i = j - 0 j:ℕi:ℕh:NStep R 0 (v j) (v i)⊢ 0 ≤ j ∧ i = j - 0; j:ℕi:ℕh:j = i⊢ 0 ≤ j ∧ i = j - 0; All goals completed! 🐙 n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - n⊢ ∀ {j i : ℕ}, NStep R (n + 1) (v j) (v i) → n + 1 ≤ j ∧ i = j - (n + 1) n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - nj:ℕi:ℕh:NStep R (n + 1) (v j) (v i)⊢ n + 1 ≤ j ∧ i = j - (n + 1) n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - nj:ℕi:ℕz:Sthz:R (v j) zhzi:NStep R n z (v i)⊢ n + 1 ≤ j ∧ i = j - (n + 1) cases j with n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕz:Sthzi:NStep R n z (v i)hz:R (v 0) z⊢ n + 1 ≤ 0 ∧ i = 0 - (n + 1) All goals completed! 🐙 n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕz:Sthzi:NStep R n z (v i)j:ℕhz:R (v (j + 1)) z⊢ n + 1 ≤ j + 1 ∧ i = j + 1 - (n + 1) n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n u (v i)⊢ n + 1 ≤ j + 1 ∧ i = j + 1 - (n + 1)n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n (v j) (v i)⊢ n + 1 ≤ j + 1 ∧ i = j + 1 - (n + 1) n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n u (v i)⊢ n + 1 ≤ j + 1 ∧ i = j + 1 - (n + 1) n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n u (v i)this:offChain (v i)⊢ n + 1 ≤ j + 1 ∧ i = j + 1 - (n + 1) All goals completed! 🐙 n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n (v j) (v i)⊢ n + 1 ≤ j + 1 ∧ i = j + 1 - (n + 1) n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n (v j) (v i)h1:n ≤ jh2:i = j - n⊢ n + 1 ≤ j + 1 ∧ i = j + 1 - (n + 1) exact ⟨n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n (v j) (v i)h1:n ≤ jh2:i = j - n⊢ n + 1 ≤ j + 1 All goals completed! 🐙, n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n (v j) (v i)h1:n ≤ jh2:i = j - n⊢ i = j + 1 - (n + 1) All goals completed! 🐙⟩

The bisimulation of MG with itself

The common vocabulary {a, p}: the proposition letter p = ·0 and the atomic program a = ·0.

def commonVoc : Vocab := {Sum.inl 0, Sum.inr 0}

The common vocabulary of ⋀Γ₁ and ¬⋀Γ₂ is {a, p}.

lemma voc_gammaOne_gammaTwo : (con gammaOne).voc ∩ (~con gammaTwo).voc = commonVoc := ⊢ (con gammaOne).voc ∩ (~con gammaTwo).voc = commonVoc All goals completed! 🐙

The bisimulation: every state is related to itself, and moreover w i to v i.

def Z (x y : St) : Prop := x = y ∨ (∃ i, x = w i ∧ y = v i)
lemma Z_rfl (x : St) : Z x x := Or.inl rfllemma Z_w_v (i : ℕ) : Z (w i) (v i) := Or.inr ⟨i, rfl, rfl⟩

Z is a bisimulation of MG with itself for the common vocabulary {a, p}.

theorem Z_isBisim : IsBisim MG MG Z commonVoc where atoms := ⊢ ∀ (x y : St), Z x y → ∀ n ∈ commonVoc.atomProps, MG.val x n ↔ MG.val y n x:Sty:Sthxy:Z x yn:ℕhn:n ∈ commonVoc.atomProps⊢ MG.val x n ↔ MG.val y n x:Sty:Sthxy:Z x yhn:0 ∈ commonVoc.atomProps⊢ MG.val x 0 ↔ MG.val y 0 x:Sthn:0 ∈ commonVoc.atomProps⊢ MG.val x 0 ↔ MG.val x 0hn:0 ∈ commonVoc.atomPropsi:ℕ⊢ MG.val (w i) 0 ↔ MG.val (v i) 0 x:Sthn:0 ∈ commonVoc.atomProps⊢ MG.val x 0 ↔ MG.val x 0 All goals completed! 🐙 hn:0 ∈ commonVoc.atomPropsi:ℕ⊢ MG.val (w i) 0 ↔ MG.val (v i) 0 All goals completed! 🐙 zig := ⊢ ∀ (x y : St), Z x y → ∀ c ∈ commonVoc.atomProgs, ∀ (x' : St), MG.Rel c x x' → ∃ y', MG.Rel c y y' ∧ Z x' y' x:Sty:Sthxy:Z x yc:ℕhc:c ∈ commonVoc.atomProgsx':Sthxx':MG.Rel c x x'⊢ ∃ y', MG.Rel c y y' ∧ Z x' y' x:Sty:Sthxy:Z x yx':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 x x'⊢ ∃ y', MG.Rel 0 y y' ∧ Z x' y' x:Stx':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 x x'⊢ ∃ y', MG.Rel 0 x y' ∧ Z x' y'x':Sthc:0 ∈ commonVoc.atomProgsi:ℕhxx':MG.Rel 0 (w i) x'⊢ ∃ y', MG.Rel 0 (v i) y' ∧ Z x' y' x:Stx':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 x x'⊢ ∃ y', MG.Rel 0 x y' ∧ Z x' y' All goals completed! 🐙 x':Sthc:0 ∈ commonVoc.atomProgsi:ℕhxx':MG.Rel 0 (w i) x'⊢ ∃ y', MG.Rel 0 (v i) y' ∧ Z x' y' cases i with x':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 (w 0) x'⊢ ∃ y', MG.Rel 0 (v 0) y' ∧ Z x' y' All goals completed! 🐙 x':Sthc:0 ∈ commonVoc.atomProgsi:ℕhxx':MG.Rel 0 (w (i + 1)) x'⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z x' y' hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z u y'hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z (w i) y' hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z u y' All goals completed! 🐙 hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z (w i) y' All goals completed! 🐙 zag := ⊢ ∀ (x y : St), Z x y → ∀ c ∈ commonVoc.atomProgs, ∀ (y' : St), MG.Rel c y y' → ∃ x', MG.Rel c x x' ∧ Z x' y' x:Sty:Sthxy:Z x yc:ℕhc:c ∈ commonVoc.atomProgsy':Sthyy':MG.Rel c y y'⊢ ∃ x', MG.Rel c x x' ∧ Z x' y' x:Sty:Sthxy:Z x yy':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 y y'⊢ ∃ x', MG.Rel 0 x x' ∧ Z x' y' x:Sty':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 x y'⊢ ∃ x', MG.Rel 0 x x' ∧ Z x' y'y':Sthc:0 ∈ commonVoc.atomProgsi:ℕhyy':MG.Rel 0 (v i) y'⊢ ∃ x', MG.Rel 0 (w i) x' ∧ Z x' y' x:Sty':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 x y'⊢ ∃ x', MG.Rel 0 x x' ∧ Z x' y' All goals completed! 🐙 y':Sthc:0 ∈ commonVoc.atomProgsi:ℕhyy':MG.Rel 0 (v i) y'⊢ ∃ x', MG.Rel 0 (w i) x' ∧ Z x' y' cases i with y':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 (v 0) y'⊢ ∃ x', MG.Rel 0 (w 0) x' ∧ Z x' y' All goals completed! 🐙 y':Sthc:0 ∈ commonVoc.atomProgsi:ℕhyy':MG.Rel 0 (v (i + 1)) y'⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' y' hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' uhc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' (v i) hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' u All goals completed! 🐙 hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' (v i) All goals completed! 🐙

The chains w i and v i agree on all {a, p}-formulas.

lemma eval_w_v {φ : Formula} (hφ : φ.voc ⊆ commonVoc) (i : ℕ) : evaluate MG (w i) φ ↔ evaluate MG (v i) φ := Z_isBisim.evaluate φ hφ _ _ (Z_w_v i)

Depth-bounded equivalence of m and v j

The claim proved by induction in the proof of depth_equiv: the states m and v k agree on any test-free formula φ over the common vocabulary {a, p}, for any k from the modal depth of φ onwards.

theorem depth_equiv_claim : ∀ (φ : Formula), φ.testFree → φ.voc ⊆ commonVoc → ∀ k, mdepth φ ≤ k → (evaluate MG m φ ↔ evaluate MG (v k) φ) | ⊥, _, _, _, _ => Iff.rfl n:ℕx✝¹:(·n).testFreehv:(·n).voc ⊆ commonVock:ℕx✝:mdepth (·n) ≤ k⊢ evaluate MG m (·n) ↔ evaluate MG (v k) (·n) n:ℕx✝¹:(·n).testFreehv:(·n).voc ⊆ commonVock:ℕx✝:mdepth (·n) ≤ k⊢ evaluate MG m (·n) ↔ evaluate MG (v k) (·n) k:ℕx✝¹:(·0).testFreehv:(·0).voc ⊆ commonVocx✝:mdepth (·0) ≤ k⊢ evaluate MG m (·0) ↔ evaluate MG (v k) (·0) All goals completed! 🐙 φ:Formulahf:(~φ).testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ evaluate MG m (~φ) ↔ evaluate MG (v k) (~φ) φ:Formulahf:(~φ).testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ evaluate MG m (~φ) ↔ evaluate MG (v k) (~φ) φ:Formulahf:φ.testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ evaluate MG m (~φ) ↔ evaluate MG (v k) (~φ) φ:Formulahf:φ.testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ ¬evaluate MG m φ ↔ ¬evaluate MG (v k) φ All goals completed! 🐙 φ:Formulaψ:Formulahf:(φ ⋀ ψ).testFreehv:(φ ⋀ ψ).voc ⊆ commonVock:ℕhk:mdepth (φ ⋀ ψ) ≤ k⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ) φ:Formulaψ:Formulahf:(φ ⋀ ψ).testFreehv:(φ ⋀ ψ).voc ⊆ commonVock:ℕhk:mdepth (φ ⋀ ψ) ≤ k⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ) φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreehv:(φ ⋀ ψ).voc ⊆ commonVock:ℕhk:mdepth (φ ⋀ ψ) ≤ k⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ) φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreek:ℕhk:mdepth (φ ⋀ ψ) ≤ khv:φ.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVoc⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ) φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreek:ℕhk:mdepth (φ ⋀ ψ) ≤ khv:φ.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVoc⊢ evaluate MG m φ ∧ evaluate MG m ψ ↔ evaluate MG (v k) φ ∧ evaluate MG (v k) ψ φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreek:ℕhv:φ.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochk:mdepth φ ≤ k ∧ mdepth ψ ≤ k⊢ evaluate MG m φ ∧ evaluate MG m ψ ↔ evaluate MG (v k) φ ∧ evaluate MG (v k) ψ All goals completed! 🐙 α:Programψ:Formulahf:(⌈α⌉ψ).testFreehv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ k⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) α:Programψ:Formulahf:(⌈α⌉ψ).testFreehv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ k⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) α:Programψ:Formulahf:α.testFree ∧ ψ.testFreehv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ k⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) α:Programψ:Formulahv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ khα:α.testFreehψ:ψ.testFree⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) α:Programψ:Formulak:ℕhk:mdepth (⌈α⌉ψ) ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVoc⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) -- `α` is test-free over `{a, p}`, so `voc α ⊆ {a}` α:Programψ:Formulak:ℕhk:mdepth (⌈α⌉ψ) ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ (∀ (n : ℕ), L α n → ∀ (v : St), NStep R n m v → evaluate MG v ψ) ↔ ∀ (n : ℕ), L α n → ∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψ α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ ∀ (a : ℕ), (L α a → ∀ (v : St), NStep R a m v → evaluate MG v ψ) ↔ L α a → ∀ (v : St), NStep R a (St.v k) v → evaluate MG v ψ; α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕ⊢ (L α n → ∀ (v : St), NStep R n m v → evaluate MG v ψ) ↔ L α n → ∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψ; α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕ⊢ L α n → ((∀ (v : St), NStep R n m v → evaluate MG v ψ) ↔ ∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψ); α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α n⊢ (∀ (v : St), NStep R n m v → evaluate MG v ψ) ↔ ∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψ -- compare the witnesses reached in exactly `n` steps from `m` and from `v k` α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α n⊢ (∀ (v : St), NStep R n m v → evaluate MG v ψ) → ∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψα:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α n⊢ (∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψ) → ∀ (v : St), NStep R n m v → evaluate MG v ψ case mpr α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α n⊢ (∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψ) → ∀ (v : St), NStep R n m v → evaluate MG v ψ -- from the `m`-column to the `v k`-column α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψy:Sthy:NStep R n m y⊢ evaluate MG y ψ -- here `k ≥ 1`, since `⌈α⌉ψ` has depth at least `1` α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α ny:Sthy:NStep R n m yj:ℕhk:mdepth ψ + 1 ≤ j + 1h:∀ (v : St), NStep R n (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG y ψ α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α 0hy:NStep R 0 m yh:∀ (v : St), NStep R 0 (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG y ψα:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α (0 + 1)hy:NStep R (0 + 1) m yh:∀ (v : St), NStep R (0 + 1) (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG y ψα:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1n:ℕa✝:L α (n + 1 + 1)hy:NStep R (n + 1 + 1) m yh:∀ (v : St), NStep R (n + 1 + 1) (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG y ψ α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α 0hy:NStep R 0 m yh:∀ (v : St), NStep R 0 (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG y ψ -- `y = m`, matched by `v k` α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α 0h:∀ (v : St), NStep R 0 (St.v (j + 1)) v → evaluate MG v ψhy:m = y⊢ evaluate MG y ψ; α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}j:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α 0h:∀ (v : St), NStep R 0 (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG m ψ α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}j:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α 0h:∀ (v : St), NStep R 0 (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG (v (j + 1)) ψ All goals completed! 🐙 α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α (0 + 1)hy:NStep R (0 + 1) m yh:∀ (v : St), NStep R (0 + 1) (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG y ψ -- the witnesses `u` and `m` are matched by `u` and `v (k-1)` α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}j:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) (St.v (j + 1)) v → evaluate MG v ψhy:NStep R (0 + 1) m u⊢ evaluate MG u ψα:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}j:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) (St.v (j + 1)) v → evaluate MG v ψhy:NStep R (0 + 1) m m⊢ evaluate MG m ψ α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}j:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) (St.v (j + 1)) v → evaluate MG v ψhy:NStep R (0 + 1) m u⊢ evaluate MG u ψ All goals completed! 🐙 α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}j:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) (St.v (j + 1)) v → evaluate MG v ψhy:NStep R (0 + 1) m m⊢ evaluate MG m ψ α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}j:ℕhk:mdepth ψ + 1 ≤ j + 1a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) (St.v (j + 1)) v → evaluate MG v ψhy:NStep R (0 + 1) m m⊢ evaluate MG (v j) ψ All goals completed! 🐙 α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1n:ℕa✝:L α (n + 1 + 1)hy:NStep R (n + 1 + 1) m yh:∀ (v : St), NStep R (n + 1 + 1) (St.v (j + 1)) v → evaluate MG v ψ⊢ evaluate MG y ψ -- `n ≥ 2`: `y` is off the chain and also reached from `v k` in `n` steps exact h y (v_NStep y (NStep_offChain (α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1n:ℕa✝:L α (n + 1 + 1)hy:NStep R (n + 1 + 1) m yh:∀ (v : St), NStep R (n + 1 + 1) (St.v (j + 1)) v → evaluate MG v ψ⊢ offChain m All goals completed! 🐙) hy) (α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1n:ℕa✝:L α (n + 1 + 1)hy:NStep R (n + 1 + 1) m yh:∀ (v : St), NStep R (n + 1 + 1) (St.v (j + 1)) v → evaluate MG v ψ⊢ 1 ≤ j + 1 All goals completed! 🐙) (α:Programψ:Formulahα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}y:Stj:ℕhk:mdepth ψ + 1 ≤ j + 1n:ℕa✝:L α (n + 1 + 1)hy:NStep R (n + 1 + 1) m yh:∀ (v : St), NStep R (n + 1 + 1) (St.v (j + 1)) v → evaluate MG v ψ⊢ 2 ≤ n + 1 + 1 All goals completed! 🐙)) case mp α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α n⊢ (∀ (v : St), NStep R n m v → evaluate MG v ψ) → ∀ (v : St), NStep R n (St.v k) v → evaluate MG v ψ -- from the `v k`-column to the `m`-column α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n m v → evaluate MG v ψy:Sthy:NStep R n (v k) y⊢ evaluate MG y ψ α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n m v → evaluate MG v ψy:Sthy:NStep R n (v k) yhoff:offChain y⊢ evaluate MG y ψα:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n m v → evaluate MG v ψy:Sthy:NStep R n (v k) yhoff:¬offChain y⊢ evaluate MG y ψ α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n m v → evaluate MG v ψy:Sthy:NStep R n (v k) yhoff:offChain y⊢ evaluate MG y ψ -- off the chain: `y` is reached from `m` in the same number of steps All goals completed! 🐙 α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n m v → evaluate MG v ψy:Sthy:NStep R n (v k) yhoff:¬offChain y⊢ evaluate MG y ψ -- on the chain: `y = v (k - n)` α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n m v → evaluate MG v ψi:ℕhy:NStep R n (v k) (v i)hoff:¬offChain (v i)⊢ evaluate MG (v i) ψ α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α nh:∀ (v : St), NStep R n m v → evaluate MG v ψhn:n ≤ khy:NStep R n (v k) (v (k - n))hoff:¬offChain (v (k - n))⊢ evaluate MG (v (k - n)) ψ α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}a✝:L α 0h:∀ (v : St), NStep R 0 m v → evaluate MG v ψhn:0 ≤ khy:NStep R 0 (v k) (v (k - 0))hoff:¬offChain (v (k - 0))⊢ evaluate MG (v (k - 0)) ψα:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) m v → evaluate MG v ψhn:0 + 1 ≤ khy:NStep R (0 + 1) (v k) (v (k - (0 + 1)))hoff:¬offChain (v (k - (0 + 1)))⊢ evaluate MG (v (k - (0 + 1))) ψα:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α (n + 1 + 1)h:∀ (v : St), NStep R (n + 1 + 1) m v → evaluate MG v ψhn:n + 1 + 1 ≤ khy:NStep R (n + 1 + 1) (v k) (v (k - (n + 1 + 1)))hoff:¬offChain (v (k - (n + 1 + 1)))⊢ evaluate MG (v (k - (n + 1 + 1))) ψ α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}a✝:L α 0h:∀ (v : St), NStep R 0 m v → evaluate MG v ψhn:0 ≤ khy:NStep R 0 (v k) (v (k - 0))hoff:¬offChain (v (k - 0))⊢ evaluate MG (v (k - 0)) ψ -- `y = v k`, matched by `m` itself α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}a✝:L α 0h:∀ (v : St), NStep R 0 m v → evaluate MG v ψhn:0 ≤ khy:NStep R 0 (v k) (v (k - 0))hoff:¬offChain (v (k - 0))⊢ evaluate MG m ψ All goals completed! 🐙 α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) m v → evaluate MG v ψhn:0 + 1 ≤ khy:NStep R (0 + 1) (v k) (v (k - (0 + 1)))hoff:¬offChain (v (k - (0 + 1)))⊢ evaluate MG (v (k - (0 + 1))) ψ -- `y = v (k-1)`, matched by `m` α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}a✝:L α (0 + 1)h:∀ (v : St), NStep R (0 + 1) m v → evaluate MG v ψhn:0 + 1 ≤ khy:NStep R (0 + 1) (v k) (v (k - (0 + 1)))hoff:¬offChain (v (k - (0 + 1)))⊢ evaluate MG m ψ All goals completed! 🐙 α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α (n + 1 + 1)h:∀ (v : St), NStep R (n + 1 + 1) m v → evaluate MG v ψhn:n + 1 + 1 ≤ khy:NStep R (n + 1 + 1) (v k) (v (k - (n + 1 + 1)))hoff:¬offChain (v (k - (n + 1 + 1)))⊢ evaluate MG (v (k - (n + 1 + 1))) ψ -- `y = v (k-n)` with `n ≥ 2`, matched by `w (k-n)` α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α (n + 1 + 1)h:∀ (v : St), NStep R (n + 1 + 1) m v → evaluate MG v ψhn:n + 1 + 1 ≤ khy:NStep R (n + 1 + 1) (v k) (v (k - (n + 1 + 1)))hoff:¬offChain (v (k - (n + 1 + 1)))⊢ evaluate MG (w (k - (n + 1 + 1))) ψ exact h (w _) (m_NStep _ (α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α (n + 1 + 1)h:∀ (v : St), NStep R (n + 1 + 1) m v → evaluate MG v ψhn:n + 1 + 1 ≤ khy:NStep R (n + 1 + 1) (v k) (v (k - (n + 1 + 1)))hoff:¬offChain (v (k - (n + 1 + 1)))⊢ offChain (w (k - (n + 1 + 1))) All goals completed! 🐙) (α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}n:ℕa✝:L α (n + 1 + 1)h:∀ (v : St), NStep R (n + 1 + 1) m v → evaluate MG v ψhn:n + 1 + 1 ≤ khy:NStep R (n + 1 + 1) (v k) (v (k - (n + 1 + 1)))hoff:¬offChain (v (k - (n + 1 + 1)))⊢ 2 ≤ n + 1 + 1 All goals completed! 🐙))

Key lemma. The states m and v j agree test-free on {a, p} up to j, i.e. they satisfy the same test-free formulas over the common vocabulary of modal depth at most j.

theorem depth_equiv (j : ℕ) : agree MG commonVoc j m (v j) := fun φ hφ hv hj => depth_equiv_claim φ hφ hv j hj

Γ₁ holds at m, Γ₂ holds at v j

Every state reachable from a state off the chain is off the chain.

lemma offChain_reach {x y : St} (hx : offChain x) (h : Relation.ReflTransGen R x y) : offChain y := x:Sty:Sthx:offChain xh:Relation.ReflTransGen R x y⊢ offChain y induction h with x:Sty:Sthx:offChain x⊢ offChain x All goals completed! 🐙 x:Sty:Sthx:offChain xb✝:Stc✝:Sta✝:Relation.ReflTransGen R x b✝hstep:R b✝ c✝IH:offChain b✝⊢ offChain c✝ All goals completed! 🐙
theorem gammaOne_at_m : ∀ φ ∈ gammaOne, evaluate MG m φ := ⊢ ∀ φ ∈ gammaOne, evaluate MG m φ ⊢ MG.val m 2 ∧ ∀ (v : St), Relation.ReflTransGen (MG.Rel 0) m v → MG.val v 0 → MG.val v 2 → (∃ u, MG.Rel 0 v u) ∧ ∀ (u : St), MG.Rel 0 v u → MG.val u 2 refine ⟨⊢ MG.val m 2 All goals completed! 🐙, ?_⟩ -- the only `a*`-reachable `p ∧ s`-state is `m` itself y:Sthy:Relation.ReflTransGen (MG.Rel 0) m yhpy:MG.val y 0hsy:MG.val y 2⊢ (∃ u, MG.Rel 0 y u) ∧ ∀ (u : St), MG.Rel 0 y u → MG.val u 2 y:Sthy:Relation.ReflTransGen (MG.Rel 0) m yhpy:MG.val y 0hsy:MG.val y 2hoff:offChain y⊢ (∃ u, MG.Rel 0 y u) ∧ ∀ (u : St), MG.Rel 0 y u → MG.val u 2 cases y with hy:Relation.ReflTransGen (MG.Rel 0) m uhpy:MG.val u 0hsy:MG.val u 2hoff:offChain u⊢ (∃ u, MG.Rel 0 St.u u) ∧ ∀ (u : St), MG.Rel 0 St.u u → MG.val u 2 All goals completed! 🐙 hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ (∃ u, MG.Rel 0 m u) ∧ ∀ (u : St), MG.Rel 0 m u → MG.val u 2 exact ⟨⟨m, Or.inr rfl⟩, hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ ∀ (u : St), MG.Rel 0 m u → MG.val u 2 hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val u 2hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val m 2 hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val u 2hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val m 2 All goals completed! 🐙⟩ i:ℕhy:Relation.ReflTransGen (MG.Rel 0) m (w i)hpy:MG.val (w i) 0hsy:MG.val (w i) 2hoff:offChain (w i)⊢ (∃ u, MG.Rel 0 (w i) u) ∧ ∀ (u : St), MG.Rel 0 (w i) u → MG.val u 2 All goals completed! 🐙 i:ℕhy:Relation.ReflTransGen (MG.Rel 0) m (v i)hpy:MG.val (v i) 0hsy:MG.val (v i) 2hoff:offChain (v i)⊢ (∃ u, MG.Rel 0 (v i) u) ∧ ∀ (u : St), MG.Rel 0 (v i) u → MG.val u 2 All goals completed! 🐙

The a-chain from v j down to v 0.

lemma v_reach_zero (j : ℕ) : Relation.ReflTransGen R (v j) (v 0) := j:ℕ⊢ Relation.ReflTransGen R (v j) (v 0) induction j with ⊢ Relation.ReflTransGen R (v 0) (v 0) All goals completed! 🐙 j:ℕIH:Relation.ReflTransGen R (v j) (v 0)⊢ Relation.ReflTransGen R (v (j + 1)) (v 0) All goals completed! 🐙
theorem gammaTwo_at_v (j : ℕ) : ∀ φ ∈ gammaTwo, evaluate MG (v j) φ := j:ℕ⊢ ∀ φ ∈ gammaTwo, evaluate MG (v j) φ j:ℕ⊢ (∀ (v : St), Relation.ReflTransGen (MG.Rel 0) (St.v j) v → MG.val v 1 → MG.val v 0) ∧ (∀ (v : St), Relation.ReflTransGen (MG.Rel 0) (St.v j) v → ∀ (u : St), MG.Rel 0 v u → MG.val u 1 → MG.val v 1) ∧ ∃ v, Relation.ReflTransGen (MG.Rel 0) (St.v j) v ∧ MG.val v 1 ∧ ∀ (u : St), ¬MG.Rel 0 v u j:ℕ⊢ (∀ (v : St), Relation.ReflTransGen R (St.v j) v → MG.val v 1 → MG.val v 0) ∧ (∀ (v : St), Relation.ReflTransGen R (St.v j) v → ∀ (u : St), R v u → MG.val u 1 → MG.val v 1) ∧ ∃ v, Relation.ReflTransGen R (St.v j) v ∧ MG.val v 1 ∧ ∀ (u : St), ¬R v u refine ⟨?_, ?_, v 0, v_reach_zero j, j:ℕ⊢ MG.val (v 0) 1 All goals completed! 🐙, fun _ h => h⟩ j:ℕ⊢ ∀ (v : St), Relation.ReflTransGen R (St.v j) v → MG.val v 1 → MG.val v 0 -- `q → p` is globally true j:ℕy:Sta✝:Relation.ReflTransGen R (v j) yhqy:MG.val y 1⊢ MG.val y 0 j:ℕa✝:Relation.ReflTransGen R (v j) uhqy:MG.val u 1⊢ MG.val u 0j:ℕa✝:Relation.ReflTransGen R (v j) mhqy:MG.val m 1⊢ MG.val m 0j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (w a✝¹)hqy:MG.val (w a✝¹) 1⊢ MG.val (w a✝¹) 0j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (v a✝¹)hqy:MG.val (v a✝¹) 1⊢ MG.val (v a✝¹) 0 j:ℕa✝:Relation.ReflTransGen R (v j) uhqy:MG.val u 1⊢ MG.val u 0j:ℕa✝:Relation.ReflTransGen R (v j) mhqy:MG.val m 1⊢ MG.val m 0j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (w a✝¹)hqy:MG.val (w a✝¹) 1⊢ MG.val (w a✝¹) 0j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (v a✝¹)hqy:MG.val (v a✝¹) 1⊢ MG.val (v a✝¹) 0 All goals completed! 🐙 j:ℕ⊢ ∀ (v : St), Relation.ReflTransGen R (St.v j) v → ∀ (u : St), R v u → MG.val u 1 → MG.val v 1 -- any state with a `q`-successor is a `q`-state j:ℕy:Sta✝:Relation.ReflTransGen R (v j) yz:Sthyz:R y zhqz:MG.val z 1⊢ MG.val y 1 cases y with j:ℕz:Sthqz:MG.val z 1a✝:Relation.ReflTransGen R (v j) uhyz:R u z⊢ MG.val u 1 j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val u 1hyz:R u u⊢ MG.val u 1j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val m 1hyz:R u m⊢ MG.val u 1j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (w a✝) 1hyz:R u (w a✝)⊢ MG.val u 1j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (v a✝) 1hyz:R u (v a✝)⊢ MG.val u 1 j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val u 1hyz:R u u⊢ MG.val u 1j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val m 1hyz:R u m⊢ MG.val u 1j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (w a✝) 1hyz:R u (w a✝)⊢ MG.val u 1j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (v a✝) 1hyz:R u (v a✝)⊢ MG.val u 1 All goals completed! 🐙 j:ℕz:Sthqz:MG.val z 1a✝:Relation.ReflTransGen R (v j) mhyz:R m z⊢ MG.val m 1 j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val u 1⊢ MG.val m 1j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val m 1⊢ MG.val m 1 j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val u 1⊢ MG.val m 1j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val m 1⊢ MG.val m 1 All goals completed! 🐙 j:ℕz:Sthqz:MG.val z 1i:ℕa✝:Relation.ReflTransGen R (v j) (w i)hyz:R (w i) z⊢ MG.val (w i) 1 cases i with j:ℕz:Sthqz:MG.val z 1a✝:Relation.ReflTransGen R (v j) (w 0)hyz:R (w 0) z⊢ MG.val (w 0) 1 All goals completed! 🐙 j:ℕz:Sthqz:MG.val z 1i:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hyz:R (w (i + 1)) z⊢ MG.val (w (i + 1)) 1 j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val u 1⊢ MG.val (w (i + 1)) 1j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val (w i) 1⊢ MG.val (w (i + 1)) 1 j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val u 1⊢ MG.val (w (i + 1)) 1j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val (w i) 1⊢ MG.val (w (i + 1)) 1 All goals completed! 🐙 j:ℕz:Sthqz:MG.val z 1i:ℕa✝:Relation.ReflTransGen R (v j) (v i)hyz:R (v i) z⊢ MG.val (v i) 1 All goals completed! 🐙

In MG we have m ⊨ Γ₁ and v j ⊨ Γ₂ for any j.

theorem model_sat : (MG, m) ⊨ gammaOne ∧ ∀ j, (MG, v j) ⊨ gammaTwo := ⟨gammaOne_at_m, gammaTwo_at_v⟩

Main theorem

Γ₁ ; Γ₂ has no test-free interpolant: there is no test-free interpolant for ⋀Γ₁ → ¬⋀Γ₂.

theorem no_interpolant : ¬ ∃ θ : Formula, θ.testFree ∧ Interpolant (con gammaOne) (~con gammaTwo) θ := ⊢ ¬∃ θ, θ.testFree ∧ Interpolant (con gammaOne) (~con gammaTwo) θ θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ (con gammaOne).voc ∩ (~con gammaTwo).voch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))⊢ False θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))⊢ False -- `θ` holds at `m` ... θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))hm:evaluate MG m θ⊢ False -- ... but not at `v j` where `j` is the modal depth of `θ` θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))hm:evaluate MG m θhv:¬evaluate MG (v (mdepth θ)) θ⊢ False All goals completed! 🐙

Test-free PDL does not have Craig interpolation: not every valid implication between test-free formulas has a test-free interpolant.

theorem testFree_no_interpolation : ¬ ∀ φ ψ : Formula, φ.testFree → ψ.testFree → tautology (φ ↣ ψ) → ∃ θ : Formula, θ.testFree ∧ Interpolant φ ψ θ := fun h => no_interpolant (h (con gammaOne) (~con gammaTwo) (h:∀ (φ ψ : Formula), φ.testFree → ψ.testFree → tautology (~(φ ⋀ ~ψ)) → ∃ θ, θ.testFree ∧ Interpolant φ ψ θ⊢ (con gammaOne).testFree All goals completed! 🐙) (h:∀ (φ ψ : Formula), φ.testFree → ψ.testFree → tautology (~(φ ⋀ ~ψ)) → ∃ θ, θ.testFree ∧ Interpolant φ ψ θ⊢ (~con gammaTwo).testFree All goals completed! 🐙) gammaOne_gammaTwo_taut)
end TestfreeNoItp