(* The safety property of the system TCG *)

(* Specifications: *)
Lemma lema_safeTCG : ForAll TrGlobal SiniTCG safeTCG.
Definition Inv9 (s : StGlobal) :=
match s with
| ((st, x), ((_, y), (_, z))) =>
st = Near /\ gt_Ck x kc1 \/ st = Inside -> eq_Ck y (plus_Ck z kc1)
end.
Lemma lema_Inv9 : ForAll TrGlobal SiniTCG Inv9.
Definition Inv10 (s : StGlobal) :=
match s with
| (_, ((sc, _), (sg, _))) =>
sc = Sc1 \/ sc = Sc2 -> sg = Open \/ sg = Raising
end.
Lemma lema_Inv10 : ForAll TrGlobal SiniTCG Inv10.
Definition Inv11 (s : StGlobal) :=
match s with
| (_, ((sc, _), (sg, _))) =>
sg = Lowering \/ sg = Closed -> sc = Sc3 \/ sc = Sc4
end.
Lemma lema_Inv11 : ForAll TrGlobal SiniTCG Inv11.
Definition Inv12 (s : StGlobal) :=
match s with
| (_, ((sc, y), (_, z))) => sc = Sc2 -> ge_Ck z y
end.
Lemma lema_Inv12 : ForAll TrGlobal SiniTCG Inv12.
Definition Inv13 (s : StGlobal) :=
match s with
| ((st, _), ((sc, _), _)) => sc = Sc2 -> st = Near
end.
Lemma lema_Inv13 : ForAll TrGlobal SiniTCG Inv13.
Definition Inv14 (s : StGlobal) :=
match s with
| ((st, _), ((sc, _), (sg, _))) => sc = Sc4 -> st = Far /\ sg = Closed
end.
Lemma lema_Inv14 : ForAll TrGlobal SiniTCG Inv14.
Definition InvSc3 (s : StGlobal) :=
match s with
| (_, ((sc, y), _)) => sc = Sc3 -> ge_Ck y kc1
end.
Lemma lema_InvSc3 : ForAll TrGlobal SiniTCG InvSc3.
Definition InvInside (s : StGlobal) :=
match s with
| ((st, x), _) => st = Inside -> gt_Ck x kt1
end.
Lemma lema_InvInside : ForAll TrGlobal SiniTCG InvInside.
(* Lemmas, definitions and auxiliar tactics for the NonZeno property *)
Lemma InvT' :
forall s : S_Ck ST,
match s with
| (st, x) =>
st = Far \/ st = Near /\ lt_Ck x kt2 \/ st = Inside /\ lt_Ck x kt2 ->
InvT s
end.
Lemma InvC' :
forall s : S_Ck SC,
match s with
| (sc, y) =>
sc = Sc1 \/
sc = Sc2 /\ le_Ck y kc1 \/ sc = Sc3 \/ sc = Sc4 /\ lt_Ck y kc2 ->
InvC s
end.
Lemma InvG' :
forall s : S_Ck SG,
match s with
| (sg, z) =>
sg = Open \/
sg = Lowering /\ lt_Ck z kg1 \/
sg = Closed \/ sg = Raising /\ lt_Ck z kg3 ->
InvG s
end.
Lemma NoImpl : forall A B : Prop, (A -> B) -> ~ B -> ~ A.
Lemma not_3_and :
forall A B C : Prop, ~ (A /\ B /\ C) -> ~ A \/ A /\ ~ B \/ A /\ B /\ ~ C.