Local Open Scope logic_base.
Local Open Scope syntax.
Local Open Scope kripke_model.
Section Canonical.
Context {L: Language}
{minL: MinimunLanguage L}
{pL: PropositionalLanguage L}
{sL: SeparationLanguage L}
{Gamma: ProofTheory L}
{SC: NormalSequentCalculus L Gamma}
{bSC: BasicSequentCalculus L Gamma}
{minSC: MinimunSequentCalculus L Gamma}
{ipSC: IntuitionisticPropositionalSequentCalculus L Gamma}
{AX: NormalAxiomatization L Gamma}
{minAX: MinimunAxiomatization L Gamma}
{ipGamma: IntuitionisticPropositionalLogic L Gamma}
{sGamma: SeparationLogic L Gamma}
{MD: Model}
{kMD: KripkeModel MD}
{M: Kmodel}
{R: Relation (Kworlds M)}
{J: Join (Kworlds M)}
{SM: Semantics L MD}
{fsSM: SeparatingSemantics L MD M SM}.
Context (cP: context -> Prop)
(rel: bijection (Kworlds M) (sig cP)).
Hypothesis H_R: forall m n Phi Psi, rel m Phi -> rel n Psi -> (m <= n <-> Included _ (proj1_sig Phi) (proj1_sig Psi)).
Hypothesis H_J: forall m1 m2 m Phi1 Phi2 Phi, rel m1 Phi1 -> rel m2 Phi2 -> rel m Phi -> (join m1 m2 m <-> Included _ (context_sepcon (proj1_sig Phi1) (proj1_sig Phi2)) (proj1_sig Phi)).
Instance SA
(AL_DC: at_least derivable_closed cP)
(LIN_SR: forall (Phi: context) (Psi: sig cP), Lindenbaum_constructable (context_sepcon_included_r Phi (proj1_sig Psi)) cP):
SeparationAlgebra (Kworlds M).
Instance uSA
(AL_DC: at_least derivable_closed cP):
UpwardsClosedSeparationAlgebra (Kworlds M).
Instance dSA
(AL_DC: at_least derivable_closed cP):
DownwardsClosedSeparationAlgebra (Kworlds M).

Lemma ext_canonical_residual
{ExtSGamma: ExtSeparationLogic L Gamma}
(AL_DC: at_least derivable_closed cP)
(LIN_SL: forall (Phi: context) (Psi: sig cP), Lindenbaum_constructable (context_sepcon_included_l Phi (proj1_sig Psi)) cP):
ResidualSeparationAlgebra (Kworlds M).