module A201607.BasicIS4.Equipment.KripkeDyadicCanonical where
open import A201607.BasicIS4.Syntax.Common public
module Syntax
(_⊢_ : Cx² Ty Ty → Ty → Set)
(mono²⊢ : ∀ {A Π Π′} → Π ⊆² Π′ → Π ⊢ A → Π′ ⊢ A)
(up : ∀ {A Π} → Π ⊢ (□ A) → Π ⊢ (□ □ A))
(down : ∀ {A Π} → Π ⊢ (□ A) → Π ⊢ A)
(lift : ∀ {A Γ Δ} → (Γ ⁏ Δ) ⊢ A → (□⋆ Γ ⁏ Δ) ⊢ (□ A))
where
Worldᶜ : Set
Worldᶜ = Cx² Ty Ty
infix 3 _≤ᶜ_
_≤ᶜ_ : Worldᶜ → Worldᶜ → Set
_≤ᶜ_ = _⊆²_
refl≤ᶜ : ∀ {w} → w ≤ᶜ w
refl≤ᶜ = refl⊆²
trans≤ᶜ : ∀ {w w′ w″} → w ≤ᶜ w′ → w′ ≤ᶜ w″ → w ≤ᶜ w″
trans≤ᶜ = trans⊆²
bot≤ᶜ : ∀ {w} → ∅² ≤ᶜ w
bot≤ᶜ = bot⊆²
infix 3 _Rᶜ_
_Rᶜ_ : Worldᶜ → Worldᶜ → Set
w Rᶜ w′ = ∀ {A} → w ⊢ (□ A) → w′ ⊢ A
reflRᶜ : ∀ {w} → w Rᶜ w
reflRᶜ = down
transRᶜ : ∀ {w w′ w″} → w Rᶜ w′ → w′ Rᶜ w″ → w Rᶜ w″
transRᶜ ζ ζ′ = ζ′ ∘ ζ ∘ up
botRᶜ : ∀ {w} → ∅² Rᶜ w
botRᶜ = mono²⊢ bot≤ᶜ ∘ down
liftRᶜ : ∀ {Γ Δ} → Γ ⁏ Δ Rᶜ □⋆ Γ ⁏ Δ
liftRᶜ = down ∘ lift ∘ down
infix 3 _≤⨾Rᶜ_
_≤⨾Rᶜ_ : Worldᶜ → Worldᶜ → Set
_≤⨾Rᶜ_ = _≤ᶜ_ ⨾ _Rᶜ_
infix 3 _R⨾≤ᶜ_
_R⨾≤ᶜ_ : Worldᶜ → Worldᶜ → Set
_R⨾≤ᶜ_ = _Rᶜ_ ⨾ _≤ᶜ_
refl≤⨾Rᶜ : ∀ {w} → w ≤⨾Rᶜ w
refl≤⨾Rᶜ {w} = w , (refl≤ᶜ , reflRᶜ)
reflR⨾≤ᶜ : ∀ {w} → w R⨾≤ᶜ w
reflR⨾≤ᶜ {w} = w , (reflRᶜ , refl≤ᶜ)
≤⨾R→Rᶜ : ∀ {v′ w} → w ≤⨾Rᶜ v′ → w Rᶜ v′
≤⨾R→Rᶜ (w′ , (ξ , ζ)) = ζ ∘ mono²⊢ ξ
R⨾≤→Rᶜ : ∀ {w v′} → w R⨾≤ᶜ v′ → w Rᶜ v′
R⨾≤→Rᶜ (v , (ζ , ξ)) = mono²⊢ ξ ∘ ζ
≤⨾R→R⨾≤ᶜ : ∀ {v′ w} → w ≤⨾Rᶜ v′ → w R⨾≤ᶜ v′
≤⨾R→R⨾≤ᶜ {v′} ξ,ζ = v′ , (≤⨾R→Rᶜ ξ,ζ , refl≤ᶜ)
transR⨾≤ᶜ : ∀ {w′ w w″} → w R⨾≤ᶜ w′ → w′ R⨾≤ᶜ w″ → w R⨾≤ᶜ w″
transR⨾≤ᶜ {w′} (v , (ζ , ξ)) (v′ , (ζ′ , ξ′)) = let v″ , (ζ″ , ξ″) = ≤⨾R→R⨾≤ᶜ (w′ , (ξ , ζ′))
in v″ , (transRᶜ ζ ζ″ , trans≤ᶜ ξ″ ξ′)
≤→Rᶜ : ∀ {v′ w} → w ≤ᶜ v′ → w Rᶜ v′
≤→Rᶜ {v′} ξ = ≤⨾R→Rᶜ (v′ , (ξ , reflRᶜ))
R⨾≤→≤⨾Rᶜ : ∀ {w v′} → w R⨾≤ᶜ v′ → w ≤⨾Rᶜ v′
R⨾≤→≤⨾Rᶜ {w} ζ,ξ = w , (refl≤ᶜ , R⨾≤→Rᶜ ζ,ξ)
trans≤⨾Rᶜ : ∀ {w′ w w″} → w ≤⨾Rᶜ w′ → w′ ≤⨾Rᶜ w″ → w ≤⨾Rᶜ w″
trans≤⨾Rᶜ {w′} (v , (ξ , ζ)) (v′ , (ξ′ , ζ′)) = let v″ , (ξ″ , ζ″) = R⨾≤→≤⨾Rᶜ (w′ , (ζ , ξ′))
in v″ , (trans≤ᶜ ξ ξ″ , transRᶜ ζ″ ζ′)
≤→Rᶜ′ : ∀ {w v′} → w ≤ᶜ v′ → w Rᶜ v′
≤→Rᶜ′ {w} ξ = R⨾≤→Rᶜ (w , (reflRᶜ , ξ))
infix 3 _≤⊓Rᶜ_
_≤⊓Rᶜ_ : Worldᶜ → Worldᶜ → Set
_≤⊓Rᶜ_ = _≤ᶜ_ ⊓ _Rᶜ_
infix 3 _R⊓≤ᶜ_
_R⊓≤ᶜ_ : Worldᶜ → Worldᶜ → Set
_R⊓≤ᶜ_ = _Rᶜ_ ⊓ _≤ᶜ_
≤⊓R→R⊓≤ᶜ : ∀ {w′ v} → w′ ≤⊓Rᶜ v → v R⊓≤ᶜ w′
≤⊓R→R⊓≤ᶜ (w , (ξ , ζ)) = w , (ζ , ξ)
R⊓≤→≤⊓Rᶜ : ∀ {w′ v} → v R⊓≤ᶜ w′ → w′ ≤⊓Rᶜ v
R⊓≤→≤⊓Rᶜ (w , (ζ , ξ)) = w , (ξ , ζ)
infix 3 _≤⊔Rᶜ_
_≤⊔Rᶜ_ : Worldᶜ → Worldᶜ → Set
_≤⊔Rᶜ_ = _≤ᶜ_ ⊔ _Rᶜ_
infix 3 _R⊔≤ᶜ_
_R⊔≤ᶜ_ : Worldᶜ → Worldᶜ → Set
_R⊔≤ᶜ_ = _Rᶜ_ ⊔ _≤ᶜ_
≤⊔R→R⊔≤ᶜ : ∀ {w′ v} → w′ ≤⊔Rᶜ v → v R⊔≤ᶜ w′
≤⊔R→R⊔≤ᶜ (v′ , (ξ , ζ)) = v′ , (ζ , ξ)
R⊔≤→≤⊔Rᶜ : ∀ {w′ v} → v R⊔≤ᶜ w′ → w′ ≤⊔Rᶜ v
R⊔≤→≤⊔Rᶜ (v′ , (ζ , ξ)) = v′ , (ξ , ζ)
≤⊓R→≤⊔Rᶜ : ∀ {v w′} → w′ ≤⊓Rᶜ v → v ≤⊔Rᶜ w′
≤⊓R→≤⊔Rᶜ {v} {w′} (w , (ξ , ζ)) =
(w′ ⧺² v) , (weak⊆²⧺₂ , mono²⊢ (weak⊆²⧺₁ v) ∘ down)
≤⊔R→≤⊓Rᶜ : ∀ {w′ v} → v ≤⊔Rᶜ w′ → w′ ≤⊓Rᶜ v
≤⊔R→≤⊓Rᶜ (v′ , (ξ , ζ)) = ∅² , (bot≤ᶜ , botRᶜ)