Section trivial_phase_semantics.
Variables (n : nat) (s : ill_vars -> vec nat n -> Prop).
Reserved Notation "'⟦' A '⟧'" (at level 65).
Definition ill_tps_imp (X Y : _ -> Prop) (v : vec _ n) := forall x, X x -> Y (vec_plus x v).
Definition ill_tps_mult (X Y : _ -> Prop) (x : vec _ n) := exists a b, x = vec_plus a b /\ X a /\ Y b.
Infix "**" := ill_tps_mult (at level 65, right associativity).
Infix "-*" := ill_tps_imp (at level 65, right associativity).
Fact ll_tps_mult_mono (X1 X2 Y1 Y2 : _ -> Prop) :
(forall x, X1 x -> X2 x)
-> (forall x, Y1 x -> Y2 x)
-> (forall x, (X1**Y1) x -> (X2**Y2) x).
Fixpoint ill_tps A x : Prop :=
match A with
| £ X     => s X x
| A & B   => ⟦A⟧ x /\ ⟦B⟧ x
| !A      => ⟦A⟧ x /\ x = vec_zero
| A ⊸ B   => (⟦A⟧ -* ⟦B⟧) x
| A ⊗ B   => (⟦A⟧ ** ⟦B⟧) x
| A ⊕ B   => ⟦A⟧ x \/ ⟦B⟧ x
| ⟘              => False
| ⟙              => True
| 𝝐               => x = vec_zero
end
where "⟦ A ⟧" := (ill_tps A).
Reserved Notation "'[[' Γ ']]'" (at level 0).
Fixpoint ill_tps_list Γ :=
match Γ with
| ∅    => eq vec_zero
| A::Γ => ⟦A⟧ ** [[Γ]]
end
where "[[ Γ ]]" := (ill_tps_list Γ).
Fact ill_tps_app Γ Δ x : [[Γ++Δ]] x <-> ([[Γ]]**[[Δ]]) x.
Fact ill_tps_lbang Γ x : [[‼Γ]] x <-> [[Γ]] x /\ x = vec_zero.
Fact ill_tps_list_bang_zero Γ : [[‼Γ]] vec_zero <-> forall A, In A Γ -> ⟦A⟧ vec_zero.
(* Symbols for cut&paste ⟙   ⟘   𝝐  ﹠ ⊗  ⊕  ⊸  ❗   ‼  ∅  ⊢ ⟦ ⟧ Γ Δ Σ*)
Fact ill_tps_perm Γ Δ : Γ ~p Δ -> forall x, [[Γ]] x -> [[Δ]] x.
Definition ill_sequent_tps Γ A := [[Γ]] -* ⟦A⟧.
Notation "'[<' Γ '|-' A '>]'" := (ill_sequent_tps Γ A).
Fact ill_sequent_tps_mono Γ A B :
(forall x, ⟦A⟧ x -> ⟦B⟧ x) -> forall x, [< Γ |- A >] x -> [< Γ |- B >] x.
Fact ill_perm_tps Γ Δ : Γ ~p Δ -> forall x A, [< Γ |- A >] x -> [< Δ |- A >] x.
Fact ill_sequent_tps_eq  Γ A : [< Γ |- A >] vec_zero <-> forall x, [[Γ]] x -> ⟦A⟧ x.

Theorem ill_tps_sound Γ A : Γ ⊢ A -> [< Γ |- A >] vec_zero.