(* File: Kripke_Trees.v  (last edited on 25/10/2000) (c) Klaus Weich  *)
Require Export AvlTrees.
Require Export Trees.
Require Export Derivations.
(*******   Kripke_Model    ****************************************)
Inductive Kripke_Model (A : Set) (World : A -> Type)
(le : A -> A -> Type) (forces0 : A -> Int -> Prop) : Type :=
kripke_model :
(forall k : A, World k -> le k k) ->
(forall k0 k1 k2 : A,
World k0 -> World k1 -> World k2 -> le k0 k1 -> le k1 k2 -> le k0 k2) ->
(forall k0 k1 : A,
World k0 ->
World k1 -> le k0 k1 -> forall i : Int, forces0 k0 i -> forces0 k1 i) ->
Kripke_Model A World le forces0.
Fixpoint forces (A : Set) (World : A -> Type)
(le : A -> A -> Type) (forces0 : A -> Int -> Prop)
(k : A) (a : form) {struct a} : Prop :=
match a with
| Falsum => False
| Atom i => forces0 k i
| AndF a0 a1 =>
forces A World le forces0 k a0 /\ forces A World le forces0 k a1
| OrF a0 a1 =>
forces A World le forces0 k a0 \/ forces A World le forces0 k a1
| Imp a0 a1 =>
forall k' : A,
World k' ->
le k k' ->
forces A World le forces0 k' a0 -> forces A World le forces0 k' a1
end.
intros A World le forces0 kripke k a w; elim a; clear a.
simpl in |- *.
trivial.
intros.
elim kripke.
intros refl trans mon.
simpl in |- *; apply (mon k k'); assumption.
intros a ih_a b ih_b.
simpl in |- *.
intros u0; elim u0; clear u0; intros u0 u1.
intros; split.
apply ih_a; assumption.
apply ih_b; assumption.
intros a ih_a b ih_b.
simpl in |- *.
intros u0; elim u0; clear u0; intros u0.
intros; left.
apply ih_a; assumption.
intros; right.
apply ih_b; assumption.
intros a ih_a b ih_b.
simpl in |- *.
intros.
apply H.
assumption.
elim kripke.
intros refl trans mon.
apply (trans k k' k'0); assumption.
assumption.
Qed.

Lemma soundness :
forall (t : proof_term) (context : flist) (a : form),
derives context t a ->
forall (A : Set) (World : A -> Type) (le : A -> A -> Type)
(forces0 : A -> Int -> Prop),
Kripke_Model A World le forces0 ->
forall k : A,
World k ->
(forall c : form, In c context -> forces A World le forces0 k c) ->
forces A World le forces0 k a.