Theory Infinite_Proof_Soundness
theory Infinite_Proof_Soundness
imports Finite_Proof_Soundness "HOL-Library.BNF_Corec"
begin
section ‹Soundness of Infinite Proof Trees›
context
begin
private definition "num P xs ≡ LEAST n. list_all (Not o P) (stake n xs) ∧ P (xs!!n)"
private lemma num:
assumes ev: "ev (λxs. P (shd xs)) xs"
defines "n ≡ num P xs"
shows
"(list_all (Not o P) (stake n xs) ∧ P (xs!!n)) ∧
(∀m. list_all (Not o P) (stake m xs) ∧ P (xs!!m) ⟶ n ≤ m)"
unfolding n_def num_def
proof (intro conjI[OF LeastI_ex] allI impI Least_le)
from ev show "∃n. list_all (Not o P) (stake n xs) ∧ P (xs !! n)"
by (induct rule: ev_induct_strong) (auto intro: exI[of _ 0] exI[of _ "Suc _"])
qed (simp_all add: o_def)
private lemma num_stl[simp]:
assumes "ev (λxs. P (shd xs)) xs" and "¬ P (shd xs)"
shows "num P xs = Suc (num P (stl xs))"
unfolding num_def by (rule trans[OF Least_Suc[of _ "num P xs"]])
(auto simp: num[OF assms(1)] assms(2))