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 falseTest-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 everyj(gammaTwo_at_v),mandv jsatisfy 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 → xfor every statexoff the chain, that is, for everyxother than thev i,m → u,m → m,w (i+1) → u, w iandv (i+1) → u, v i,w 0andv 0have 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 vDashThe two sets of formulas
abbrev p : Formula := ·0abbrev q : Formula := ·1abbrev s : Formula := ·2abbrev a : Program := ·0The body of the left star formula: (p ∧ s) → (⟨a⟩⊤ ∧ [a]s).
(A def, not an abbrev, so that simp only [evaluate] leaves it alone.)
Γ₁ = { s, [a*]((p ∧ s) → (⟨a⟩⊤ ∧ [a]s)) }
Γ₂ = { [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
have h2 : ∀ φ ∈ gammaTwo, evaluate M w φ := fun φ hφ => hw φ (by W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φφ:Formulahφ:φ ∈ gammaTwo⊢ φ ∈ gammaOne ++ gammaTwo simp [hφ] All goals completed! 🐙) W:TypeM:KripkeModel Ww:Whw:∀ φ ∈ gammaOne ++ gammaTwo, evaluate M w φh1:∀ φ ∈ gammaOne, evaluate M w φh2:∀ φ ∈ gammaTwo, evaluate M w φ⊢ False
obtain ⟨hs, hbody⟩ := (gammaOne_iff M w).mp h1 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
obtain ⟨hqp, -, v, hv, hqv, hdead⟩ := (gammaTwo_iff M w).mp h2 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`
have hsv : M.val v 2 := by ⊢ ¬satisfiable (gammaOne ++ gammaTwo)
suffices ∀ x, Relation.ReflTransGen (fun x y => M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w x →
Relation.ReflTransGen (M.Rel 0) w x ∧ M.val x 2 from (this v (gammaTwo_path h2 hv hqv)).2 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⊢ ∀ (x : W),
Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w x →
Relation.ReflTransGen (M.Rel 0) w x ∧ M.val x 2
intro x hx 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 ux:Whx:Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w x⊢ Relation.ReflTransGen (M.Rel 0) w x ∧ M.val x 2
induction hx with
| refl => refl 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 ux:W⊢ Relation.ReflTransGen (M.Rel 0) w w ∧ M.val w 2 exact ⟨.refl, hs⟩ All goals completed! 🐙
| tail _ hxu IH => tail 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 ux:Wb✝:Wc✝:Wa✝:Relation.ReflTransGen (fun x y ↦ M.Rel 0 x y ∧ M.val x 0 ∧ M.val x 1) w b✝hxu:M.Rel 0 b✝ c✝ ∧ M.val b✝ 0 ∧ M.val b✝ 1IH:Relation.ReflTransGen (M.Rel 0) w b✝ ∧ M.val b✝ 2⊢ Relation.ReflTransGen (M.Rel 0) w c✝ ∧ M.val c✝ 2 exact ⟨IH.1.tail hxu.1, (hbody _ IH.1 hxu.2.1 IH.2).2 _ hxu.1⟩ 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
obtain ⟨u, hu⟩ := (hbody v hv (hqp v hv hqv) hsv).1 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
exact hdead u hu All goals completed! 🐙Thus ⋀Γ₁ → ¬⋀Γ₂ is valid.
theorem gammaOne_gammaTwo_taut : tautology (con gammaOne ↣ ~con gammaTwo) := by ⊢ tautology (~(con gammaOne ⋀ ~~con gammaTwo))
intro W M w W:TypeM:KripkeModel Ww:W⊢ evaluate M w (~(con gammaOne ⋀ ~~con gammaTwo))
simp only [evaluate, conEval, not_and, not_not] W:TypeM:KripkeModel Ww:W⊢ (∀ f ∈ gammaOne, evaluate M w f) → ¬∀ f ∈ gammaTwo, evaluate M w f
intro h1 h2 W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w f⊢ False
refine gammaOne_gammaTwo_unsat ⟨W, M, w, fun φ hφ => ?_⟩ W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne ++ gammaTwo⊢ evaluate M w φ
simp only [List.mem_append] at hφ W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne ∨ φ ∈ gammaTwo⊢ evaluate M w φ
rcases hφ with hφ | hφ inl W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne⊢ evaluate M w φinr W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaTwo⊢ evaluate M w φ
· inl W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaOne⊢ evaluate M w φ exact h1 φ hφ All goals completed! 🐙
· inr W:TypeM:KripkeModel Ww:Wh1:∀ f ∈ gammaOne, evaluate M w fh2:∀ f ∈ gammaTwo, evaluate M w fφ:Formulahφ:φ ∈ gammaTwo⊢ evaluate M w φ exact h2 φ hφ 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.
open StValuation 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 = 1The 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, _ => FalseThe model MG: the atomic program a = ·0 has the relation R, all other atomic
programs have the empty relation.
@[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 := rflThe 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.
lemma R_u {y : St} (hy : offChain y) : R u y := by y:Sthy:offChain y⊢ R u y cases y u hy:offChain u⊢ R u um hy:offChain m⊢ R u mw a✝:ℕhy:offChain (w a✝)⊢ R u (w a✝)v a✝:ℕhy:offChain (v a✝)⊢ R u (v a✝) <;> u hy:offChain u⊢ R u um hy:offChain m⊢ R u mw a✝:ℕhy:offChain (w a✝)⊢ R u (w a✝)v a✝:ℕhy:offChain (v a✝)⊢ R u (v a✝) simp_all [R] All goals completed! 🐙lemma offChain_R {x y : St} (hx : offChain x) (h : R x y) : offChain y := by x:Sty:Sthx:offChain xh:R x y⊢ offChain y
cases x with
| u => u y:Sthx:offChain uh:R u y⊢ offChain y cases y u.u hx:offChain uh:R u u⊢ offChain uu.m hx:offChain uh:R u m⊢ offChain mu.w hx:offChain ua✝:ℕh:R u (w a✝)⊢ offChain (w a✝)u.v hx:offChain ua✝:ℕh:R u (v a✝)⊢ offChain (v a✝) <;> u.u hx:offChain uh:R u u⊢ offChain uu.m hx:offChain uh:R u m⊢ offChain mu.w hx:offChain ua✝:ℕh:R u (w a✝)⊢ offChain (w a✝)u.v hx:offChain ua✝:ℕh:R u (v a✝)⊢ offChain (v a✝) simp_all [R] All goals completed! 🐙
| m => m y:Sthx:offChain mh:R m y⊢ offChain y rcases h with rfl | rfl m.inl hx:offChain m⊢ offChain um.inr hx:offChain m⊢ offChain m <;> m.inl hx:offChain m⊢ offChain um.inr hx:offChain m⊢ offChain m simp All goals completed! 🐙
| w i => w y:Sti:ℕhx:offChain (w i)h:R (w i) y⊢ offChain y
cases i with
| zero => w.zero y:Sthx:offChain (w 0)h:R (w 0) y⊢ offChain y exact h.elim All goals completed! 🐙
| succ i => w.succ y:Sti:ℕhx:offChain (w (i + 1))h:R (w (i + 1)) y⊢ offChain y rcases h with rfl | rfl w.succ.inl i:ℕhx:offChain (w (i + 1))⊢ offChain uw.succ.inr i:ℕhx:offChain (w (i + 1))⊢ offChain (w i) <;> w.succ.inl i:ℕhx:offChain (w (i + 1))⊢ offChain uw.succ.inr i:ℕhx:offChain (w (i + 1))⊢ offChain (w i) simp All goals completed! 🐙
| v i => v y:Sti:ℕhx:offChain (v i)h:R (v i) y⊢ offChain y exact hx.elim All goals completed! 🐙lemma NStep_offChain {n : ℕ} {x y : St} (hx : offChain x) (h : NStep R n x y) :
offChain y := by n:ℕx:Sty:Sthx:offChain xh:NStep R n x y⊢ offChain y
induction n generalizing x with
| zero => zero y:Stx:Sthx:offChain xh:NStep R 0 x y⊢ offChain y simp only [NStep_zero] at h zero y:Stx:Sthx:offChain xh:x = y⊢ offChain y; subst h zero x:Sthx:offChain x⊢ offChain x; exact hx All goals completed! 🐙
| succ n IH => succ 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 obtain ⟨z, hz, hzy⟩ := h succ 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; exact IH (offChain_R hx hz) hzy 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 := by y:Sthy:offChain y⊢ ∀ (n : ℕ), 1 ≤ n → NStep R n u y
intro n hn y:Sthy:offChain yn:ℕhn:1 ≤ n⊢ NStep R n u y
induction n with
| zero => zero y:Sthy:offChain yhn:1 ≤ 0⊢ NStep R 0 u y omega All goals completed! 🐙
| succ n IH => succ y:Sthy:offChain yn:ℕIH:1 ≤ n → NStep R n u yhn:1 ≤ n + 1⊢ NStep R (n + 1) u y
cases n with
| zero => succ.zero y:Sthy:offChain yIH:1 ≤ 0 → NStep R 0 u yhn:1 ≤ 0 + 1⊢ NStep R (0 + 1) u y exact ⟨y, R_u hy, rfl⟩ All goals completed! 🐙
| succ n => succ.succ 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 (by y:Sthy:offChain yn:ℕIH:1 ≤ n + 1 → NStep R (n + 1) u yhn:1 ≤ n + 1 + 1⊢ offChain u simp All goals completed! 🐙), IH (by y:Sthy:offChain yn:ℕIH:1 ≤ n + 1 → NStep R (n + 1) u yhn:1 ≤ n + 1 + 1⊢ 1 ≤ n + 1 omega 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 := by y:Sthy:offChain yn:ℕhn:2 ≤ n⊢ NStep R n m y
obtain ⟨k, rfl⟩ : ∃ k, n = k + 1 := ⟨n - 1, by y:Sthy:offChain yn:ℕhn:2 ≤ n⊢ n = n - 1 + 1 omega All goals completed! 🐙⟩ y:Sthy:offChain yk:ℕhn:2 ≤ k + 1⊢ NStep R (k + 1) m y
exact ⟨u, Or.inl rfl, u_NStep y hy k (by y:Sthy:offChain yk:ℕhn:2 ≤ k + 1⊢ 1 ≤ k omega All goals completed! 🐙)⟩lemma NStep_one_m {y : St} : NStep R 1 m y ↔ y = u ∨ y = m := by y:St⊢ NStep R 1 m y ↔ y = u ∨ y = m
simp only [NStep_succ, NStep_zero] y:St⊢ (∃ u, R m u ∧ u = y) ↔ y = u ∨ y = m
constructor mp y:St⊢ (∃ u, R m u ∧ u = y) → y = u ∨ y = mmpr y:St⊢ y = u ∨ y = m → ∃ u, R m u ∧ u = y
· mp y:St⊢ (∃ u, R m u ∧ u = y) → y = u ∨ y = m rintro ⟨z, h, rfl⟩ mp z:Sth:R m z⊢ z = u ∨ z = m; exact h All goals completed! 🐙
· mpr y:St⊢ y = u ∨ y = m → ∃ u, R m u ∧ u = y intro h mpr y:Sth:y = u ∨ y = m⊢ ∃ u, R m u ∧ u = y; exact ⟨y, h, rfl⟩ 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 := by y:Sthy:offChain yj:ℕn:ℕhj:1 ≤ jhn:2 ≤ n⊢ NStep R n (v j) y
obtain ⟨k, rfl⟩ : ∃ k, n = k + 1 := ⟨n - 1, by y:Sthy:offChain yj:ℕn:ℕhj:1 ≤ jhn:2 ≤ n⊢ n = n - 1 + 1 omega All goals completed! 🐙⟩ y:Sthy:offChain yj:ℕhj:1 ≤ jk:ℕhn:2 ≤ k + 1⊢ NStep R (k + 1) (v j) y
obtain ⟨i, rfl⟩ : ∃ i, j = i + 1 := ⟨j - 1, by y:Sthy:offChain yj:ℕhj:1 ≤ jk:ℕhn:2 ≤ k + 1⊢ j = j - 1 + 1 omega All goals completed! 🐙⟩ 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 (by y:Sthy:offChain yk:ℕhn:2 ≤ k + 1i:ℕhj:1 ≤ i + 1⊢ 1 ≤ k omega 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 := by n:ℕj:ℕy:Sthy:offChain yh:NStep R n (v j) y⊢ NStep R n m y
rcases n with _ | _ | n zero j:ℕy:Sthy:offChain yh:NStep R 0 (v j) y⊢ NStep R 0 m ysucc.zero j:ℕy:Sthy:offChain yh:NStep R (0 + 1) (v j) y⊢ NStep R (0 + 1) m ysucc.succ j:ℕy:Sthy:offChain yn:ℕh:NStep R (n + 1 + 1) (v j) y⊢ NStep R (n + 1 + 1) m y
· zero j:ℕy:Sthy:offChain yh:NStep R 0 (v j) y⊢ NStep R 0 m y simp only [NStep_zero] at h zero j:ℕy:Sthy:offChain yh:v j = y⊢ NStep R 0 m y; subst h zero j:ℕhy:offChain (v j)⊢ NStep R 0 m (v j); simp at hy All goals completed! 🐙
· succ.zero j:ℕy:Sthy:offChain yh:NStep R (0 + 1) (v j) y⊢ NStep R (0 + 1) m y obtain ⟨z, hz, hzy⟩ := h succ.zero j:ℕy:Sthy:offChain yz:Sthz:R (v j) zhzy:NStep R 0 z y⊢ NStep R (0 + 1) m y
simp only [NStep_zero] at hzy succ.zero j:ℕy:Sthy:offChain yz:Sthz:R (v j) zhzy:z = y⊢ NStep R (0 + 1) m y
subst hzy succ.zero j:ℕz:Sthz:R (v j) zhy:offChain z⊢ NStep R (0 + 1) m z
rw [NStep_one_m succ.zero j:ℕz:Sthz:R (v j) zhy:offChain z⊢ z = u ∨ z = m] succ.zero j:ℕz:Sthz:R (v j) zhy:offChain z⊢ z = u ∨ z = m
cases j with
| zero => succ.zero.zero z:Sthy:offChain zhz:R (v 0) z⊢ z = u ∨ z = m exact hz.elim All goals completed! 🐙
| succ j => succ.zero.succ z:Sthy:offChain zj:ℕhz:R (v (j + 1)) z⊢ z = u ∨ z = m
rcases hz with rfl | rfl succ.zero.succ.inl j:ℕhy:offChain u⊢ u = u ∨ u = msucc.zero.succ.inr j:ℕhy:offChain (v j)⊢ v j = u ∨ v j = m
· succ.zero.succ.inl j:ℕhy:offChain u⊢ u = u ∨ u = m exact Or.inl rfl All goals completed! 🐙
· succ.zero.succ.inr j:ℕhy:offChain (v j)⊢ v j = u ∨ v j = m simp at hy All goals completed! 🐙
· succ.succ 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 (by j:ℕy:Sthy:offChain yn:ℕh:NStep R (n + 1 + 1) (v j) y⊢ 2 ≤ n + 1 + 1 omega 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 := by n:ℕ⊢ ∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - n
induction n with
| zero => zero ⊢ ∀ {j i : ℕ}, NStep R 0 (v j) (v i) → 0 ≤ j ∧ i = j - 0 intro j i h zero j:ℕi:ℕh:NStep R 0 (v j) (v i)⊢ 0 ≤ j ∧ i = j - 0; simp only [NStep_zero, St.v.injEq] at h zero j:ℕi:ℕh:j = i⊢ 0 ≤ j ∧ i = j - 0; omega All goals completed! 🐙
| succ n IH => succ 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)
intro j i h succ 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)
obtain ⟨z, hz, hzi⟩ := h succ 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
| zero => succ.zero 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) exact hz.elim All goals completed! 🐙
| succ j => succ.succ 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)
rcases hz with rfl | rfl succ.succ.inl 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)succ.succ.inr 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)
· succ.succ.inl 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) have := NStep_offChain (x := u) (by n:ℕIH:∀ {j i : ℕ}, NStep R n (v j) (v i) → n ≤ j ∧ i = j - ni:ℕj:ℕhzi:NStep R n u (v i)⊢ offChain u simp All goals completed! 🐙) hzi succ.succ.inl 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)
simp at this All goals completed! 🐙
· succ.succ.inr 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) obtain ⟨h1, h2⟩ := IH hzi succ.succ.inr 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 ⟨by 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 omega All goals completed! 🐙, by 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) omega 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 := by ⊢ (con gammaOne).voc ∩ (~con gammaTwo).voc = commonVoc
decide All goals completed! 🐙The bisimulation: every state is related to itself, and moreover w i to 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 := by ⊢ ∀ (x y : St), Z x y → ∀ n ∈ commonVoc.atomProps, MG.val x n ↔ MG.val y n
intro x y hxy n hn x:Sty:Sthxy:Z x yn:ℕhn:n ∈ commonVoc.atomProps⊢ MG.val x n ↔ MG.val y n
obtain rfl : n = 0 := by x:Sty:Sthxy:Z x yn:ℕhn:n ∈ commonVoc.atomProps⊢ n = 0 simpa [commonVoc, Vocab.atomProps] using hn x:Sty:Sthxy:Z x yhn:0 ∈ commonVoc.atomProps⊢ MG.val x 0 ↔ MG.val y 0
rcases hxy with rfl | ⟨i, rfl, rfl⟩ inl x:Sthn:0 ∈ commonVoc.atomProps⊢ MG.val x 0 ↔ MG.val x 0inr hn:0 ∈ commonVoc.atomPropsi:ℕ⊢ MG.val (w i) 0 ↔ MG.val (v i) 0
· inl x:Sthn:0 ∈ commonVoc.atomProps⊢ MG.val x 0 ↔ MG.val x 0 rfl All goals completed! 🐙
· inr hn:0 ∈ commonVoc.atomPropsi:ℕ⊢ MG.val (w i) 0 ↔ MG.val (v i) 0 simp [val] All goals completed! 🐙
zig := by ⊢ ∀ (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'
intro x y hxy c hc x' hxx' 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'
obtain rfl : c = 0 := by x:Sty:Sthxy:Z x yc:ℕhc:c ∈ commonVoc.atomProgsx':Sthxx':MG.Rel c x x'⊢ c = 0 simpa [commonVoc, Vocab.atomProgs] using hc x:Sty:Sthxy:Z x yx':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 x x'⊢ ∃ y', MG.Rel 0 y y' ∧ Z x' y'
rcases hxy with rfl | ⟨i, rfl, rfl⟩ inl x:Stx':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 x x'⊢ ∃ y', MG.Rel 0 x y' ∧ Z x' y'inr x':Sthc:0 ∈ commonVoc.atomProgsi:ℕhxx':MG.Rel 0 (w i) x'⊢ ∃ y', MG.Rel 0 (v i) y' ∧ Z x' y'
· inl x:Stx':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 x x'⊢ ∃ y', MG.Rel 0 x y' ∧ Z x' y' exact ⟨x', hxx', Z_rfl x'⟩ All goals completed! 🐙
· inr 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
| zero => inr.zero x':Sthc:0 ∈ commonVoc.atomProgshxx':MG.Rel 0 (w 0) x'⊢ ∃ y', MG.Rel 0 (v 0) y' ∧ Z x' y' exact hxx'.elim All goals completed! 🐙
| succ i => inr.succ x':Sthc:0 ∈ commonVoc.atomProgsi:ℕhxx':MG.Rel 0 (w (i + 1)) x'⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z x' y'
rcases hxx' with rfl | rfl inr.succ.inl hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z u y'inr.succ.inr hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z (w i) y'
· inr.succ.inl hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z u y' exact ⟨u, Or.inl rfl, Z_rfl u⟩ All goals completed! 🐙
· inr.succ.inr hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ y', MG.Rel 0 (v (i + 1)) y' ∧ Z (w i) y' exact ⟨v i, Or.inr rfl, Z_w_v i⟩ All goals completed! 🐙
zag := by ⊢ ∀ (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'
intro x y hxy c hc y' hyy' 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'
obtain rfl : c = 0 := by x:Sty:Sthxy:Z x yc:ℕhc:c ∈ commonVoc.atomProgsy':Sthyy':MG.Rel c y y'⊢ c = 0 simpa [commonVoc, Vocab.atomProgs] using hc x:Sty:Sthxy:Z x yy':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 y y'⊢ ∃ x', MG.Rel 0 x x' ∧ Z x' y'
rcases hxy with rfl | ⟨i, rfl, rfl⟩ inl x:Sty':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 x y'⊢ ∃ x', MG.Rel 0 x x' ∧ Z x' y'inr y':Sthc:0 ∈ commonVoc.atomProgsi:ℕhyy':MG.Rel 0 (v i) y'⊢ ∃ x', MG.Rel 0 (w i) x' ∧ Z x' y'
· inl x:Sty':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 x y'⊢ ∃ x', MG.Rel 0 x x' ∧ Z x' y' exact ⟨y', hyy', Z_rfl y'⟩ All goals completed! 🐙
· inr 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
| zero => inr.zero y':Sthc:0 ∈ commonVoc.atomProgshyy':MG.Rel 0 (v 0) y'⊢ ∃ x', MG.Rel 0 (w 0) x' ∧ Z x' y' exact hyy'.elim All goals completed! 🐙
| succ i => inr.succ y':Sthc:0 ∈ commonVoc.atomProgsi:ℕhyy':MG.Rel 0 (v (i + 1)) y'⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' y'
rcases hyy' with rfl | rfl inr.succ.inl hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' uinr.succ.inr hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' (v i)
· inr.succ.inl hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' u exact ⟨u, Or.inl rfl, Z_rfl u⟩ All goals completed! 🐙
· inr.succ.inr hc:0 ∈ commonVoc.atomProgsi:ℕ⊢ ∃ x', MG.Rel 0 (w (i + 1)) x' ∧ Z x' (v i) exact ⟨w i, Or.inr rfl, Z_w_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, _, hv, k, _ => n:ℕx✝¹:(·n).testFreehv:(·n).voc ⊆ commonVock:ℕx✝:mdepth (·n) ≤ k⊢ evaluate MG m (·n) ↔ evaluate MG (v k) (·n) by n:ℕx✝¹:(·n).testFreehv:(·n).voc ⊆ commonVock:ℕx✝:mdepth (·n) ≤ k⊢ evaluate MG m (·n) ↔ evaluate MG (v k) (·n)
obtain rfl : n = 0 := by n:ℕx✝¹:(·n).testFreehv:(·n).voc ⊆ commonVock:ℕx✝:mdepth (·n) ≤ k⊢ n = 0
simpa [commonVoc] using hv (by n:ℕx✝¹:(·n).testFreehv:(·n).voc ⊆ commonVock:ℕx✝:mdepth (·n) ≤ k⊢ Sum.inl n ∈ (·n).voc simp All goals completed! 🐙 : Sum.inl n ∈ (·n : Formula).voc) k:ℕx✝¹:(·0).testFreehv:(·0).voc ⊆ commonVocx✝:mdepth (·0) ≤ k⊢ evaluate MG m (·0) ↔ evaluate MG (v k) (·0)
simp [val] All goals completed! 🐙
| ~φ, hf, hv, k, hk => φ:Formulahf:(~φ).testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ evaluate MG m (~φ) ↔ evaluate MG (v k) (~φ) by φ:Formulahf:(~φ).testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ evaluate MG m (~φ) ↔ evaluate MG (v k) (~φ)
simp only [Formula.testFree] at hf φ:Formulahf:φ.testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ evaluate MG m (~φ) ↔ evaluate MG (v k) (~φ)
simp only [evaluate] φ:Formulahf:φ.testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ ¬evaluate MG m φ ↔ ¬evaluate MG (v k) φ
rw [depth_equiv_claim φ hf hv k hk φ:Formulahf:φ.testFreehv:(~φ).voc ⊆ commonVock:ℕhk:mdepth (~φ) ≤ k⊢ ¬evaluate MG (v k) φ ↔ ¬evaluate MG (v k) φ] All goals completed! 🐙
| φ ⋀ ψ, hf, hv, k, hk => φ:Formulaψ:Formulahf:(φ ⋀ ψ).testFreehv:(φ ⋀ ψ).voc ⊆ commonVock:ℕhk:mdepth (φ ⋀ ψ) ≤ k⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ) by φ:Formulaψ:Formulahf:(φ ⋀ ψ).testFreehv:(φ ⋀ ψ).voc ⊆ commonVock:ℕhk:mdepth (φ ⋀ ψ) ≤ k⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ)
simp only [Formula.testFree] at hf φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreehv:(φ ⋀ ψ).voc ⊆ commonVock:ℕhk:mdepth (φ ⋀ ψ) ≤ k⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ)
simp only [Formula.voc, Finset.union_subset_iff] at hv φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreek:ℕhk:mdepth (φ ⋀ ψ) ≤ khv:φ.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVoc⊢ evaluate MG m (φ ⋀ ψ) ↔ evaluate MG (v k) (φ ⋀ ψ)
simp only [evaluate] φ: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) ψ
simp only [mdepth, max_le_iff] at hk φ: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) ψ
rw [depth_equiv_claim φ hf.1 hv.1 k hk.1, φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreek:ℕhv:φ.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochk:mdepth φ ≤ k ∧ mdepth ψ ≤ k⊢ evaluate MG (v k) φ ∧ evaluate MG m ψ ↔ evaluate MG (v k) φ ∧ evaluate MG (v k) ψ depth_equiv_claim ψ hf.2 hv.2 k hk.2 φ:Formulaψ:Formulahf:φ.testFree ∧ ψ.testFreek:ℕhv:φ.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochk:mdepth φ ≤ k ∧ mdepth ψ ≤ k⊢ evaluate MG (v k) φ ∧ evaluate MG (v k) ψ ↔ evaluate MG (v k) φ ∧ evaluate MG (v k) ψ] All goals completed! 🐙
| ⌈α⌉ ψ, hf, hv, k, hk => α:Programψ:Formulahf:(⌈α⌉ψ).testFreehv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ k⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) by α:Programψ:Formulahf:(⌈α⌉ψ).testFreehv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ k⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ)
simp only [Formula.testFree] at hf α:Programψ:Formulahf:α.testFree ∧ ψ.testFreehv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ k⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ)
obtain ⟨hα, hψ⟩ := hf α:Programψ:Formulahv:(⌈α⌉ψ).voc ⊆ commonVock:ℕhk:mdepth (⌈α⌉ψ) ≤ khα:α.testFreehψ:ψ.testFree⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ)
simp only [Formula.voc, Finset.union_subset_iff] at hv α: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}`
have hvα : α.voc ⊆ {Sum.inr 0} := by
intro x hx α:Programψ:Formulak:ℕhk:mdepth (⌈α⌉ψ) ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVocx:ℕ ⊕ ℕhx:x ∈ α.voc⊢ x ∈ {Sum.inr 0}
obtain ⟨c, rfl⟩ := Program.testFree_voc α hα x hx α:Programψ:Formulak:ℕhk:mdepth (⌈α⌉ψ) ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVocc:ℕhx:Sum.inr c ∈ α.voc⊢ Sum.inr c ∈ {Sum.inr 0}
simpa [commonVoc] using hv.1 hx α:Programψ:Formulak:ℕhk:mdepth (⌈α⌉ψ) ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ)
simp only [mdepth] at hk α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ evaluate MG m (⌈α⌉ψ) ↔ evaluate MG (v k) (⌈α⌉ψ)
rw [box_iff MG α hα hvα, α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ (∀ (n : ℕ), L α n → ∀ (v : St), NStep (MG.Rel 0) n m v → evaluate MG v ψ) ↔ evaluate MG (v k) (⌈α⌉ψ) box_iff MG α hα hvα, α:Programψ:Formulak:ℕhk:mdepth ψ + 1 ≤ khα:α.testFreehψ:ψ.testFreehv:α.voc ⊆ commonVoc ∧ ψ.voc ⊆ commonVochvα:α.voc ⊆ {Sum.inr 0}⊢ (∀ (n : ℕ), L α n → ∀ (v : St), NStep (MG.Rel 0) n m v → evaluate MG v ψ) ↔
∀ (n : ℕ), L α n → ∀ (v : St), NStep (MG.Rel 0) n (St.v k) v → evaluate MG v ψ MG_Rel_zero α: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}⊢ (∀ (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 ψ
apply forall_congr' α: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 ψ; intro n α: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 ψ; apply imp_congr_right α: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 ψ); intro _ α: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`
refine Iff.intro ?mp ?mpr 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 ψ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 ψ
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
intro h y hy α: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`
obtain ⟨j, rfl⟩ : ∃ j, k = j + 1 := ⟨k - 1, by α: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⊢ k = k - 1 + 1 omega All goals completed! 🐙⟩ α: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 ψ
rcases n with _ | _ | n zero α: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 ψsucc.zero α: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 ψsucc.succ α: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 ψ
· zero α: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`
simp only [NStep_zero] at hy zero α: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 ψ; subst hy zero α: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 ψ
rw [depth_equiv_claim ψ hψ hv.2 (j + 1) (by α: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 ψ⊢ mdepth ψ ≤ j + 1 omega All goals completed! 🐙)] zero α: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)) ψ
exact h _ rfl All goals completed! 🐙
· succ.zero α: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)`
rcases NStep_one_m.mp hy with rfl | rfl succ.zero.inl α: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 ψsucc.zero.inr α: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 ψ
· succ.zero.inl α: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 ψ exact h u ⟨u, Or.inl rfl, rfl⟩ All goals completed! 🐙
· succ.zero.inr α: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 ψ rw [depth_equiv_claim ψ hψ hv.2 j (by α: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⊢ mdepth ψ ≤ j omega All goals completed! 🐙)] succ.zero.inr α: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) ψ
exact h (v j) ⟨v j, Or.inr rfl, rfl⟩ All goals completed! 🐙
· succ.succ α: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 (by α: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 simp All goals completed! 🐙) hy) (by α: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 omega All goals completed! 🐙) (by α: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 omega 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
intro h y hy α: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 ψ
by_cases hoff : offChain y pos α: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 ψneg α: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 ψ
· pos α: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
exact h y (NStep_m_of_v hoff hy) All goals completed! 🐙
· neg α: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)`
obtain ⟨i, rfl⟩ : ∃ i, y = v i := by α: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⊢ ∃ i, y = v i cases y u α: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 ψhy:NStep R n (v k) uhoff:¬offChain u⊢ ∃ i, u = v im α: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 ψhy:NStep R n (v k) mhoff:¬offChain m⊢ ∃ i, m = v iw α: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 ψa✝:ℕhy:NStep R n (v k) (w a✝)hoff:¬offChain (w a✝)⊢ ∃ i, w a✝ = v iv α: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 ψa✝:ℕhy:NStep R n (v k) (v a✝)hoff:¬offChain (v a✝)⊢ ∃ i, v a✝ = v i <;> u α: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 ψhy:NStep R n (v k) uhoff:¬offChain u⊢ ∃ i, u = v im α: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 ψhy:NStep R n (v k) mhoff:¬offChain m⊢ ∃ i, m = v iw α: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 ψa✝:ℕhy:NStep R n (v k) (w a✝)hoff:¬offChain (w a✝)⊢ ∃ i, w a✝ = v iv α: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 ψa✝:ℕhy:NStep R n (v k) (v a✝)hoff:¬offChain (v a✝)⊢ ∃ i, v a✝ = v i simp_all neg α: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) ψ
obtain ⟨hn, rfl⟩ := NStep_v_chain hy neg α: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)) ψ
rcases n with _ | _ | n neg.zero α: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)) ψneg.succ.zero α: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))) ψneg.succ.succ α: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))) ψ
· neg.zero α: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
rw [Nat.sub_zero, neg.zero α: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) ψ ← depth_equiv_claim ψ hψ hv.2 k (by α: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))⊢ mdepth ψ ≤ k omega All goals completed! 🐙)] neg.zero α: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 ψ
exact h m rfl All goals completed! 🐙
· neg.succ.zero α: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`
rw [← depth_equiv_claim ψ hψ hv.2 (k - 1) (by α: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)))⊢ mdepth ψ ≤ k - 1 omega All goals completed! 🐙)] neg.succ.zero α: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 ψ
exact h m (NStep_one_m.mpr (Or.inr rfl)) All goals completed! 🐙
· neg.succ.succ α: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)`
rw [← eval_w_v hv.2 neg.succ.succ α: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))) ψ] neg.succ.succ α: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 _ (by α: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))) simp All goals completed! 🐙) (by α: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 omega 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 := by x:Sty:Sthx:offChain xh:Relation.ReflTransGen R x y⊢ offChain y
induction h with
| refl => refl x:Sty:Sthx:offChain x⊢ offChain x exact hx All goals completed! 🐙
| tail _ hstep IH => tail x:Sty:Sthx:offChain xb✝:Stc✝:Sta✝:Relation.ReflTransGen R x b✝hstep:R b✝ c✝IH:offChain b✝⊢ offChain c✝ exact offChain_R IH hstep All goals completed! 🐙theorem gammaOne_at_m : ∀ φ ∈ gammaOne, evaluate MG m φ := by ⊢ ∀ φ ∈ gammaOne, evaluate MG m φ
rw [gammaOne_iff ⊢ 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] ⊢ 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 ⟨by ⊢ MG.val m 2 simp [val] All goals completed! 🐙, ?_⟩
-- the only `a*`-reachable `p ∧ s`-state is `m` itself
intro y hy hpy hsy 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
have hoff : offChain y := offChain_reach (by y:Sthy:Relation.ReflTransGen (MG.Rel 0) m yhpy:MG.val y 0hsy:MG.val y 2⊢ offChain m simp All goals completed! 🐙) hy 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
| u => u 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 simp [val] at hpy All goals completed! 🐙
| m => m 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⟩, by 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 rintro z (rfl | rfl) inl hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val u 2inr hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val m 2 <;> inl hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val u 2inr hy:Relation.ReflTransGen (MG.Rel 0) m mhpy:MG.val m 0hsy:MG.val m 2hoff:offChain m⊢ MG.val m 2 simp [val] All goals completed! 🐙⟩
| w i => w 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 simp [val] at hsy All goals completed! 🐙
| v i => v 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 simp at hoff 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) := by j:ℕ⊢ Relation.ReflTransGen R (v j) (v 0)
induction j with
| zero => zero ⊢ Relation.ReflTransGen R (v 0) (v 0) exact .refl All goals completed! 🐙
| succ j IH => succ j:ℕIH:Relation.ReflTransGen R (v j) (v 0)⊢ Relation.ReflTransGen R (v (j + 1)) (v 0) exact .head (Or.inr rfl) IH All goals completed! 🐙theorem gammaTwo_at_v (j : ℕ) : ∀ φ ∈ gammaTwo, evaluate MG (v j) φ := by j:ℕ⊢ ∀ φ ∈ gammaTwo, evaluate MG (v j) φ
rw [gammaTwo_iff 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 (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
simp only [MG_Rel_zero] 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, by j:ℕ⊢ MG.val (v 0) 1 simp [val] All goals completed! 🐙, fun _ h => h⟩
· refine_1 j:ℕ⊢ ∀ (v : St), Relation.ReflTransGen R (St.v j) v → MG.val v 1 → MG.val v 0 -- `q → p` is globally true
intro y _ hqy refine_1 j:ℕy:Sta✝:Relation.ReflTransGen R (v j) yhqy:MG.val y 1⊢ MG.val y 0
cases y refine_1.u j:ℕa✝:Relation.ReflTransGen R (v j) uhqy:MG.val u 1⊢ MG.val u 0refine_1.m j:ℕa✝:Relation.ReflTransGen R (v j) mhqy:MG.val m 1⊢ MG.val m 0refine_1.w j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (w a✝¹)hqy:MG.val (w a✝¹) 1⊢ MG.val (w a✝¹) 0refine_1.v j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (v a✝¹)hqy:MG.val (v a✝¹) 1⊢ MG.val (v a✝¹) 0 <;> refine_1.u j:ℕa✝:Relation.ReflTransGen R (v j) uhqy:MG.val u 1⊢ MG.val u 0refine_1.m j:ℕa✝:Relation.ReflTransGen R (v j) mhqy:MG.val m 1⊢ MG.val m 0refine_1.w j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (w a✝¹)hqy:MG.val (w a✝¹) 1⊢ MG.val (w a✝¹) 0refine_1.v j:ℕa✝¹:ℕa✝:Relation.ReflTransGen R (v j) (v a✝¹)hqy:MG.val (v a✝¹) 1⊢ MG.val (v a✝¹) 0 simp_all [val] All goals completed! 🐙
· refine_2 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
intro y _ z hyz hqz refine_2 j:ℕy:Sta✝:Relation.ReflTransGen R (v j) yz:Sthyz:R y zhqz:MG.val z 1⊢ MG.val y 1
cases y with
| u => refine_2.u j:ℕz:Sthqz:MG.val z 1a✝:Relation.ReflTransGen R (v j) uhyz:R u z⊢ MG.val u 1 cases z refine_2.u.u j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val u 1hyz:R u u⊢ MG.val u 1refine_2.u.m j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val m 1hyz:R u m⊢ MG.val u 1refine_2.u.w j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (w a✝) 1hyz:R u (w a✝)⊢ MG.val u 1refine_2.u.v j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (v a✝) 1hyz:R u (v a✝)⊢ MG.val u 1 <;> refine_2.u.u j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val u 1hyz:R u u⊢ MG.val u 1refine_2.u.m j:ℕa✝:Relation.ReflTransGen R (v j) uhqz:MG.val m 1hyz:R u m⊢ MG.val u 1refine_2.u.w j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (w a✝) 1hyz:R u (w a✝)⊢ MG.val u 1refine_2.u.v j:ℕa✝¹:Relation.ReflTransGen R (v j) ua✝:ℕhqz:MG.val (v a✝) 1hyz:R u (v a✝)⊢ MG.val u 1 simp_all [R, val] All goals completed! 🐙
| m => refine_2.m j:ℕz:Sthqz:MG.val z 1a✝:Relation.ReflTransGen R (v j) mhyz:R m z⊢ MG.val m 1 rcases hyz with rfl | rfl refine_2.m.inl j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val u 1⊢ MG.val m 1refine_2.m.inr j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val m 1⊢ MG.val m 1 <;> refine_2.m.inl j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val u 1⊢ MG.val m 1refine_2.m.inr j:ℕa✝:Relation.ReflTransGen R (v j) mhqz:MG.val m 1⊢ MG.val m 1 simp_all [val] All goals completed! 🐙
| w i => refine_2.w 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
| zero => refine_2.w.zero j:ℕz:Sthqz:MG.val z 1a✝:Relation.ReflTransGen R (v j) (w 0)hyz:R (w 0) z⊢ MG.val (w 0) 1 exact hyz.elim All goals completed! 🐙
| succ i => refine_2.w.succ 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 rcases hyz with rfl | rfl refine_2.w.succ.inl j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val u 1⊢ MG.val (w (i + 1)) 1refine_2.w.succ.inr j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val (w i) 1⊢ MG.val (w (i + 1)) 1 <;> refine_2.w.succ.inl j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val u 1⊢ MG.val (w (i + 1)) 1refine_2.w.succ.inr j:ℕi:ℕa✝:Relation.ReflTransGen R (v j) (w (i + 1))hqz:MG.val (w i) 1⊢ MG.val (w (i + 1)) 1 simp_all [val] All goals completed! 🐙
| v i => refine_2.v 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 simp [val] 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) θ := by ⊢ ¬∃ θ, θ.testFree ∧ Interpolant (con gammaOne) (~con gammaTwo) θ
rintro ⟨θ, hθ, hvoc, h1, h2⟩ θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ (con gammaOne).voc ∩ (~con gammaTwo).voch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))⊢ False
rw [voc_gammaOne_gammaTwo θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))⊢ False] at hvoc θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))⊢ False
-- `θ` holds at `m` ...
have hm : evaluate MG m θ := by ⊢ ¬∃ θ, θ.testFree ∧ Interpolant (con gammaOne) (~con gammaTwo) θ
have := h1 St MG m θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))this:evaluate MG m (~(con gammaOne ⋀ ~θ))⊢ evaluate MG m θ
simp only [evaluate, conEval, not_and, not_not] at this θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))this:(∀ f ∈ gammaOne, evaluate MG m f) → evaluate MG m θ⊢ evaluate MG m θ
exact this gammaOne_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 `θ`
have hv : ¬ evaluate MG (v (mdepth θ)) θ := by ⊢ ¬∃ θ, θ.testFree ∧ Interpolant (con gammaOne) (~con gammaTwo) θ
have := h2 St MG (v (mdepth θ)) θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))hm:evaluate MG m θthis:evaluate MG (v (mdepth θ)) (~(θ ⋀ ~~con gammaTwo))⊢ ¬evaluate MG (v (mdepth θ)) θ
simp only [evaluate, conEval, not_and, not_not] at this θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))hm:evaluate MG m θthis:evaluate MG (v (mdepth θ)) θ → ¬∀ f ∈ gammaTwo, evaluate MG (v (mdepth θ)) f⊢ ¬evaluate MG (v (mdepth θ)) θ
exact fun hθ => this hθ (gammaTwo_at_v _) θ:Formulahθ:θ.testFreehvoc:θ.voc ⊆ commonVoch1:tautology (~(con gammaOne ⋀ ~θ))h2:tautology (~(θ ⋀ ~~con gammaTwo))hm:evaluate MG m θhv:¬evaluate MG (v (mdepth θ)) θ⊢ False
exact hv ((depth_equiv (mdepth θ) θ hθ hvoc le_rfl).mp hm) 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)
(by h:∀ (φ ψ : Formula), φ.testFree → ψ.testFree → tautology (~(φ ⋀ ~ψ)) → ∃ θ, θ.testFree ∧ Interpolant φ ψ θ⊢ (con gammaOne).testFree simp [gammaOne, body] All goals completed! 🐙) (by h:∀ (φ ψ : Formula), φ.testFree → ψ.testFree → tautology (~(φ ⋀ ~ψ)) → ∃ θ, θ.testFree ∧ Interpolant φ ψ θ⊢ (~con gammaTwo).testFree simp [gammaTwo] All goals completed! 🐙) gammaOne_gammaTwo_taut)end TestfreeNoItp