End filtered_konig.
Section Safety.
Context (ST:Type)(SCH:Type).
Context (STEP:ST->SCH->ST->SCH-> Prop).
Context (valid: ST-> SCH -> Prop).
Hypothesis em: forall P, P \/ ~ P.

(* Specifications: *)
Lemma schedule_dec:
forall (U U':SCH), (U=U') \/ (U<>U').
Corollary SsafeN_ksafe: forall n st,
SsafeN n (@P_init st) -> forall U, valid st U -> ksafe st U n.
Lemma ksafe_SsafeN: forall st_init,
(forall U, valid st_init U) ->
forall n, (forall U, ksafe st_init U n) ->
SsafeN n (@P_init st_init).
Lemma Ssafe_safe': forall P,
Ssafe P -> forall st U, st \In P -> valid st U -> safe st U.
Lemma Ssafe_safe: forall st_init,
(forall U, valid st_init U) ->
Ssafe (@P_init st_init) -> forall U, safe st_init U.
(* This is too weak... but is a good example*)
Lemma SsafeN_Ssafe:
(forall P: Prop, P \/ ~ P) ->
forall P,
(forall P, finite (SST_step P)) ->
(forall n, SsafeN n P) ->
Ssafe P.
Lemma power_set_finite {X}:
(forall P : Prop, P \/ ~ P) ->
forall P: X-> Prop, finite P ->
finite (fun A => subset A P).
Lemma subset_finite {X}: forall (P P': X-> Prop), finite P -> subset P' P -> finite P'.
Lemma ksafe_safe':
(forall P: Prop, P \/ ~ P) ->
forall (propositional_extentionality: True),
forall (branches_finitely_on_the_state: forall x : ST,
@finite_on_x _ _ (possible_image (fun x y x' => exists y', STEP x y x' y') valid x)),
forall st,
(forall n U, valid st U -> ksafe st U n) ->
(forall U, valid st U -> safe st U).
Lemma ksafe_safe:
(forall P: Prop, P \/ ~ P) ->
forall (propositional_extentionality: True),
forall (branches_finitely_on_the_state: forall x : ST,
@finite_on_x _ _ (possible_image (fun x y x' => exists y', STEP x y x' y') valid x)),
forall st,
(forall U : SCH, valid st U) ->
(forall n U, ksafe st U n) ->
(forall U, safe st U).
Lemma safe_ksafe':
forall st,
(forall U, valid st U -> safe st U) ->
(forall U, valid st U -> forall n, ksafe st U n).
Lemma safe_ksafe:
forall st,
(forall U : SCH, valid st U) ->
(forall U, safe st U) ->
(forall n U, ksafe st U n).