Theory Proof_Checker
theory "Proof_Checker"
imports
Ordinary_Differential_Equations.ODE_Analysis
"Ids"
"Lib"
"Syntax"
"Denotational_Semantics"
"Axioms"
"Differential_Axioms"
"Frechet_Correctness"
"Static_Semantics"
"Coincidence"
"Bound_Effect"
"Uniform_Renaming"
"USubst_Lemma"
"Pretty_Printer"
begin context ids begin
section ‹Proof Checker›
text ‹This proof checker defines a datatype for proof terms in dL and a function for checking proof
terms, with a soundness proof that any proof accepted by the checker is a proof of a sound rule or
valid formula.
A simple concrete hybrid system and a differential invariant rule for conjunctions are provided
as example proofs.
›
lemma sound_weaken_gen:"⋀A B C. sublist A B ⟹ sound (A, C) ⟹ sound (B,C)"
proof (rule soundI_mem)
fix A B::"('sf,'sc,'sz) sequent list"
and C::"('sf,'sc,'sz) sequent"
and I::"('sf,'sc,'sz) interp"
assume sub:"sublist A B"
assume good:"is_interp I"
assume "sound (A, C)"
then have soundC:"(⋀φ. List.member A φ ⟹ seq_sem I φ = UNIV) ⟹ seq_sem I C = UNIV"
apply simp
apply(drule soundD_mem)
by (auto simp add: good)
assume SG:"(⋀φ. List.member B φ ⟹ seq_sem I φ = UNIV)"
show "seq_sem I C = UNIV"
using soundC SG sub unfolding sublist_def by auto
qed
lemma sound_weaken:"⋀SG SGS C. sound (SGS, C) ⟹ sound (SG # SGS, C)"
subgoal for SG SGS C
apply(induction SGS)
subgoal unfolding sound_def by auto
subgoal for SG2 SGS
unfolding sound_def
by (metis fst_conv le0 length_Cons not_less_eq nth_Cons_Suc snd_conv)
done
done
lemma member_filter:"⋀P. List.member (filter P L) x ⟹ List.member L x"
apply(induction L, auto)
by(metis (full_types) member_rec(1))
lemma nth_member:"n < List.length L ⟹ List.member L (List.nth L n)"
apply(induction L, auto simp add: member_rec)
by (metis in_set_member length_Cons nth_mem set_ConsD)
lemma mem_appL:"List.member A x ⟹ List.member (A @ B) x"
by(induction A, auto simp add: member_rec)
lemma sound_weaken_appR:"⋀SG SGS C. sound (SG, C) ⟹ sound (SG @ SGS, C)"
subgoal for SG SGS C
apply(rule sound_weaken_gen)
apply(auto)
unfolding sublist_def apply(rule allI)
subgoal for x
using mem_appL[of SG x SGS] by auto
done
done
fun start_proof::"('sf,'sc,'sz) sequent ⇒ ('sf,'sc,'sz) rule"
where "start_proof S = ([S], S)"
lemma start_proof_sound:"sound (start_proof S)"
unfolding sound_def by auto
section ‹Proof Checker Implementation›