Section Trivial_Phase_semantics.
(* We only consider the monoids nat^n *)
Variables (n : nat) (s : nat -> vec nat n -> Prop)
(K : bang -> vec nat n -> Prop).
Hypothesis HK_antitone : forall u v, u ≤ v -> K v ⊆ K u.
Notation ø := vec_zero.
Definition imsell_tps_mult (X Y : _ -> Prop) (x : vec _ n) := exists a b, x = vec_plus a b /\ X a /\ Y b.
Definition imsell_tps_imp (X Y : _ -> Prop) (v : vec _ n) := forall x, X x -> Y (vec_plus x v).
Infix "⊛" := imsell_tps_mult (at level 65, right associativity).
Infix "-⊛" := imsell_tps_imp (at level 65, right associativity).
Fact imsell_tps_imp_zero X Y : (X -⊛ Y) ø <-> X ⊆ Y.
Hypothesis HK_unit0 : forall u, K u ø.
Hypothesis HK_plus  : forall u, K u ⊛ K u ⊆ K u.
Hypothesis HK_unit1 : forall u, U u -> forall x, K u x -> x = ø.
Fact imsell_tps_mult_mono (X1 X2 Y1 Y2 : _ -> Prop) :
X1 ⊆ X2 -> Y1 ⊆ Y2 -> X1⊛Y1 ⊆ X2⊛Y2.
Fixpoint imsell_tps (A : imsell_form nat bang) x : Prop :=
match A with
| £ X   => s X x
| ![u]A => ⟦A⟧ x /\ K u x
| A⊸B   => (⟦A⟧-⊛⟦B⟧) x
end
where "⟦ A ⟧" := (imsell_tps A).
Fact imsell_tps_bang_zero u A : ⟦![u]A⟧ ø <-> ⟦A⟧ ø.
Reserved Notation "⟪ Γ ⟫" (at level 1, format "⟪ Γ ⟫").
Fixpoint imsell_tps_list Γ :=
match Γ with
| nil  => eq ø
| A::Γ => ⟦A⟧⊛⟪Γ⟫
end
where "⟪ Γ ⟫" := (imsell_tps_list Γ).
Fact imsell_tps_app Γ Δ x : ⟪Γ++Δ⟫ x <-> (⟪Γ⟫⊛⟪Δ⟫) x.
Fact imsell_tps_list_zero Γ : (forall A, A ∊ Γ -> ⟦A⟧ ø) -> ⟪Γ⟫ ø.
Fact imsell_tps_lbang u Γ : u ≼ Γ -> ⟪‼Γ⟫ ⊆ K u.
Fact imsell_tps_perm Γ Δ : Γ ~p Δ -> ⟪Γ⟫ ⊆ ⟪Δ⟫.
Definition imsell_sequent_tps Γ A := ⟪Γ⟫ -⊛ ⟦A⟧.
Notation "'[<' Γ '|-' A '>]'" := (imsell_sequent_tps Γ A) (at level 1, format "[<  Γ  |-  A  >]").
Fact imsell_sequent_tps_mono Γ A B :
⟦A⟧ ⊆ ⟦B⟧ -> [< Γ |- A >] ⊆ [< Γ |- B >].
Fact imsell_perm_tps Γ Δ : Γ ~p Δ -> forall A, [< Γ |- A >] ⊆ [< Δ |- A >].
Fact imsell_sequent_tps_eq Γ A : [< Γ |- A >] ø <-> ⟪Γ⟫ ⊆ ⟦A⟧.

Theorem imsell_tps_sound Γ A : Γ ⊢ A -> [< Γ |- A >] ø.