Soundness.general_soundness

Require Import List.
Export ListNotations.
Require Import Arith.
Require Import Lia.
Require Import Ensembles.

Require Import im_syntax.
Require Import CKH_export.
Require Import kripke_export.

Section general_soundness.

(* We can show that all axioms of CK are valid on all
    models of our semantics. *)


Lemma Ax_valid : A, Axioms A
  ( M w, forces M w A).
Proof.
intros A Ax. destruct Ax as [Ax | Ax].
(* Intuitionistic axioms *)
+ inversion Ax ; cbn ; intros ; subst ; cbn ; intros ; auto.
  - apply Persistence with (w:=v) ; auto.
  - apply with ; auto. apply ireach_tran with ; auto. apply ireach_refl.
  - destruct ; auto. apply ; auto. apply ireach_tran with ; auto.
  - destruct ; auto.
  - destruct ; auto.
  - split. apply ; auto. apply ireach_tran with ; auto. apply ; auto.
  - subst. apply Expl.
(* Modal axioms *)
+ inversion Ax ; cbn ; intros ; subst ; cbn ; intros.
  (* K1 *)
  - apply with u ; auto. apply ireach_tran with ; auto. apply ireach_refl.
    apply with ; auto.
  (* K2 *)
  - destruct ( _ ) as (u & & ). exists u. split ; auto. apply with u ; auto.
    apply ireach_tran with ; auto. apply ireach_refl.
Qed.


(* We can then show that if a certain class of frames validates a set of
    additional axioms, then we obtain a soundness result on this class
    of frames. *)


Variable AdAx : form Prop.
Variable FraP : frame Prop.
Hypothesis corresp_AdAx_FraP : F, FraP F ( A, AdAx A fvalid F A).

Theorem Soundness : Γ phi, (extCKH_prv AdAx Γ ) (loc_conseq FraP Γ ).
Proof.
intros Γ D. induction D ; intros C FrProp w Hw.
(* Id *)
- apply Hw ; auto.
(* Ax *)
- destruct H.
  + apply Ax_valid ; destruct H ; firstorder.
  + apply (corresp_AdAx_FraP fra FrProp A H) ; auto.
(* MP *)
- unfold loc_conseq in *. cbn in *. apply with w ; auto. apply ireach_refl.
(* Nec *)
- subst. unfold loc_conseq in *. cbn in *. intros. apply IHD ; auto.
  intros ; contradiction.
Qed.


End general_soundness.