module A201602.AltArtemov where
open import Data.Nat using (ℕ ; zero ; suc)
open import Data.Product using (_×_) renaming (_,_ to ⟨_,_⟩)
open import Data.Vec using (Vec ; [] ; _∷_ ; replicate)
infixl 10 !_ 𝑣_ 𝒗_ ¬_
infixl 10 ☆_ ☆²_ ☆³_ ☆⁴_ ☆ⁿ_ ★_ ★²_ ★³_ ★⁴_ ★ⁿ_
infixl 9 𝜋₀_ 𝜋₀²_ 𝜋₀³_ 𝜋₀⁴_ 𝜋₀ⁿ_ 𝝅₀_ 𝝅₀²_ 𝝅₀³_ 𝝅₀⁴_ 𝝅₀ⁿ_
infixl 9 𝜋₁_ 𝜋₁²_ 𝜋₁³_ 𝜋₁⁴_ 𝜋₁ⁿ_ 𝝅₁_ 𝝅₁²_ 𝝅₁³_ 𝝅₁⁴_ 𝝅₁ⁿ_
infixl 9 𝜄₀_ 𝜄₀²_ 𝜄₀³_ 𝜄₀⁴_ 𝜄₀ⁿ_ 𝜾₀_ 𝜾₀²_ 𝜾₀³_ 𝜾₀⁴_ 𝜾₀ⁿ_
infixl 9 𝜄₁_ 𝜄₁²_ 𝜄₁³_ 𝜄₁⁴_ 𝜄₁ⁿ_ 𝜾₁_ 𝜾₁²_ 𝜾₁³_ 𝜾₁⁴_ 𝜾₁ⁿ_
infixl 8 _∘_ _∘²_ _∘³_ _∘⁴_ _∘ⁿ_ _∙_ _∙²_ _∙³_ _∙⁴_ _∙ⁿ_
infixr 7 ⇑_ ⇑²_ ⇑³_ ⇑⁴_ ⇑ⁿ_ ⬆_ ⬆²_ ⬆³_ ⬆⁴_ ⬆ⁿ_
infixr 7 ⇓_ ⇓²_ ⇓³_ ⇓⁴_ ⇓ⁿ_ ⬇_ ⬇²_ ⬇³_ ⬇⁴_ ⬇ⁿ_
infixr 6 𝜆_ 𝜆²_ 𝜆³_ 𝜆⁴_ 𝜆ⁿ_ 𝝀_ 𝝀²_ 𝝀³_ 𝝀⁴_ 𝝀ⁿ_
infixr 5 _∶_ _∵_
infixl 4 _∧_
infixl 3 _∨_ _,_ _„_
infixr 2 _⊃_
infixr 1 _⫗_
infixr 0 _⊢_ ⊩_
Var : Set
Var = ℕ
data Tm : Set where
𝑣_ : Var → Tm
𝜆[_]_ : ℕ → Tm → Tm
_∘[_]_ : Tm → ℕ → Tm → Tm
𝑝[_]⟨_,_⟩ : ℕ → Tm → Tm → Tm
𝜋₀[_]_ : ℕ → Tm → Tm
𝜋₁[_]_ : ℕ → Tm → Tm
𝜄₀[_]_ : ℕ → Tm → Tm
𝜄₁[_]_ : ℕ → Tm → Tm
𝑐[_][_▷_∣_] : ℕ → Tm → Tm → Tm → Tm
!_ : Tm → Tm
⇑[_]_ : ℕ → Tm → Tm
⇓[_]_ : ℕ → Tm → Tm
☆[_]_ : ℕ → Tm → Tm
data Ty : Set where
_⊃_ : Ty → Ty → Ty
_∧_ : Ty → Ty → Ty
_∨_ : Ty → Ty → Ty
_∶_ : Tm → Ty → Ty
⊥ : Ty
⊤ : Ty
⊤ = ⊥ ⊃ ⊥
¬_ : Ty → Ty
¬ A = A ⊃ ⊥
_⫗_ : Ty → Ty → Ty
A ⫗ B = (A ⊃ B) ∧ (B ⊃ A)
𝜆_ : Tm → Tm
𝜆 t = 𝜆[ 1 ] t
_∘_ : Tm → Tm → Tm
t ∘ s = t ∘[ 1 ] s
𝑝⟨_,_⟩ : Tm → Tm → Tm
𝑝⟨ t , s ⟩ = 𝑝[ 1 ]⟨ t , s ⟩
𝜋₀_ : Tm → Tm
𝜋₀ t = 𝜋₀[ 1 ] t
𝜋₁_ : Tm → Tm
𝜋₁ t = 𝜋₁[ 1 ] t
𝜄₀_ : Tm → Tm
𝜄₀ t = 𝜄₀[ 1 ] t
𝜄₁_ : Tm → Tm
𝜄₁ t = 𝜄₁[ 1 ] t
𝑐[_▷_∣_] : Tm → Tm → Tm → Tm
𝑐[ t ▷ s ∣ r ] = 𝑐[ 1 ][ t ▷ s ∣ r ]
⇑_ : Tm → Tm
⇑ t = ⇑[ 1 ] t
⇓_ : Tm → Tm
⇓ t = ⇓[ 1 ] t
☆_ : Tm → Tm
☆ t = ☆[ 1 ] t
𝜆²_ : Tm → Tm
𝜆² t₂ = 𝜆[ 2 ] t₂
_∘²_ : Tm → Tm → Tm
t₂ ∘² s₂ = t₂ ∘[ 2 ] s₂
𝑝²⟨_,_⟩ : Tm → Tm → Tm
𝑝²⟨ t₂ , s₂ ⟩ = 𝑝[ 2 ]⟨ t₂ , s₂ ⟩
𝜋₀²_ : Tm → Tm
𝜋₀² t₂ = 𝜋₀[ 2 ] t₂
𝜋₁²_ : Tm → Tm
𝜋₁² t₂ = 𝜋₁[ 2 ] t₂
𝜄₀²_ : Tm → Tm
𝜄₀² t₂ = 𝜄₀[ 2 ] t₂
𝜄₁²_ : Tm → Tm
𝜄₁² t₂ = 𝜄₁[ 2 ] t₂
𝑐²[_▷_∣_] : Tm → Tm → Tm → Tm
𝑐²[ t₂ ▷ s₂ ∣ r₂ ] = 𝑐[ 2 ][ t₂ ▷ s₂ ∣ r₂ ]
⇑²_ : Tm → Tm
⇑² t₂ = ⇑[ 2 ] t₂
⇓²_ : Tm → Tm
⇓² t₂ = ⇓[ 2 ] t₂
☆²_ : Tm → Tm
☆² t = ☆[ 2 ] t
𝜆³_ : Tm → Tm
𝜆³ t₃ = 𝜆[ 3 ] t₃
_∘³_ : Tm → Tm → Tm
t₃ ∘³ s₃ = t₃ ∘[ 3 ] s₃
𝑝³⟨_,_⟩ : Tm → Tm → Tm
𝑝³⟨ t₃ , s₃ ⟩ = 𝑝[ 3 ]⟨ t₃ , s₃ ⟩
𝜋₀³_ : Tm → Tm
𝜋₀³ t₃ = 𝜋₀[ 3 ] t₃
𝜋₁³_ : Tm → Tm
𝜋₁³ t₃ = 𝜋₁[ 3 ] t₃
𝜄₀³_ : Tm → Tm
𝜄₀³ t₃ = 𝜄₀[ 3 ] t₃
𝜄₁³_ : Tm → Tm
𝜄₁³ t₃ = 𝜄₁[ 3 ] t₃
𝑐³[_▷_∣_] : Tm → Tm → Tm → Tm
𝑐³[ t₃ ▷ s₃ ∣ r₃ ] = 𝑐[ 3 ][ t₃ ▷ s₃ ∣ r₃ ]
⇑³_ : Tm → Tm
⇑³ t₃ = ⇑[ 3 ] t₃
⇓³_ : Tm → Tm
⇓³ t₃ = ⇓[ 3 ] t₃
☆³_ : Tm → Tm
☆³ t = ☆[ 3 ] t
𝜆⁴_ : Tm → Tm
𝜆⁴ t₄ = 𝜆[ 4 ] t₄
_∘⁴_ : Tm → Tm → Tm
t₄ ∘⁴ s₄ = t₄ ∘[ 4 ] s₄
𝑝⁴⟨_,_⟩ : Tm → Tm → Tm
𝑝⁴⟨ t₄ , s₄ ⟩ = 𝑝[ 4 ]⟨ t₄ , s₄ ⟩
𝜋₀⁴_ : Tm → Tm
𝜋₀⁴ t₄ = 𝜋₀[ 4 ] t₄
𝜋₁⁴_ : Tm → Tm
𝜋₁⁴ t₄ = 𝜋₁[ 4 ] t₄
𝜄₀⁴_ : Tm → Tm
𝜄₀⁴ t₄ = 𝜄₀[ 4 ] t₄
𝜄₁⁴_ : Tm → Tm
𝜄₁⁴ t₄ = 𝜄₁[ 4 ] t₄
𝑐⁴[_▷_∣_] : Tm → Tm → Tm → Tm
𝑐⁴[ t₄ ▷ s₄ ∣ r₄ ] = 𝑐[ 4 ][ t₄ ▷ s₄ ∣ r₄ ]
⇑⁴_ : Tm → Tm
⇑⁴ t₄ = ⇑[ 4 ] t₄
⇓⁴_ : Tm → Tm
⇓⁴ t₄ = ⇓[ 4 ] t₄
☆⁴_ : Tm → Tm
☆⁴ t = ☆[ 4 ] t
map# : ∀{n} {X Y : Set}
→ (ℕ → X → Y) → Vec X n → Vec Y n
map# {zero} f [] = []
map# {suc n} f (x ∷ 𝐱) = f (suc n) x ∷ map# f 𝐱
map2# : ∀{n} {X Y Z : Set}
→ (ℕ → X → Y → Z) → Vec X n → Vec Y n → Vec Z n
map2# {zero} f [] [] = []
map2# {suc n} f (x ∷ 𝐱) (y ∷ 𝐲) = f (suc n) x y ∷ map2# f 𝐱 𝐲
map3# : ∀{n} {X Y Z A : Set}
→ (ℕ → X → Y → Z → A) → Vec X n → Vec Y n → Vec Z n → Vec A n
map3# {zero} f [] [] [] = []
map3# {suc n} f (x ∷ 𝐱) (y ∷ 𝐲) (z ∷ 𝐳) = f (suc n) x y z ∷ map3# f 𝐱 𝐲 𝐳
Tms : ℕ → Set
Tms = Vec Tm
_∵_ : ∀{n} → Tms n → Ty → Ty
[] ∵ A = A
(x ∷ 𝐭) ∵ A = x ∶ 𝐭 ∵ A
𝑣[_]_ : (n : ℕ) → Var → Tms n
𝑣[ n ] x = replicate {n = n} (𝑣 x)
𝜆ⁿ_ : ∀{n} → Tms n → Tms n
𝜆ⁿ_ = map# 𝜆[_]_
_∘ⁿ_ : ∀{n} → Tms n → Tms n → Tms n
_∘ⁿ_ = map2# (λ n t s → t ∘[ n ] s)
𝑝ⁿ⟨_,_⟩ : ∀{n} → Tms n → Tms n → Tms n
𝑝ⁿ⟨_,_⟩ = map2# 𝑝[_]⟨_,_⟩
𝜋₀ⁿ_ : ∀{n} → Tms n → Tms n
𝜋₀ⁿ_ = map# 𝜋₀[_]_
𝜋₁ⁿ_ : ∀{n} → Tms n → Tms n
𝜋₁ⁿ_ = map# 𝜋₁[_]_
𝜄₀ⁿ_ : ∀{n} → Tms n → Tms n
𝜄₀ⁿ_ = map# 𝜄₀[_]_
𝜄₁ⁿ_ : ∀{n} → Tms n → Tms n
𝜄₁ⁿ_ = map# 𝜄₁[_]_
𝑐ⁿ[_▷_∣_] : ∀{n} → Tms n → Tms n → Tms n → Tms n
𝑐ⁿ[_▷_∣_] = map3# 𝑐[_][_▷_∣_]
⇑ⁿ_ : ∀{n} → Tms n → Tms n
⇑ⁿ_ = map# ⇑[_]_
⇓ⁿ_ : ∀{n} → Tms n → Tms n
⇓ⁿ_ = map# ⇓[_]_
☆ⁿ_ : ∀{n} → Tms n → Tms n
☆ⁿ_ = map# ☆[_]_
Hyp : Set
Hyp = ℕ × Ty
data Cx : Set where
∅ : Cx
_,_ : Cx → Hyp → Cx
_„_ : Cx → Cx → Cx
Γ „ ∅ = Γ
Γ „ (Δ , A) = Γ „ Δ , A
data _∈[_]_ : Hyp → ℕ → Cx → Set where
𝐙 : ∀{A Γ}
→ A ∈[ zero ] (Γ , A)
𝐒_ : ∀{A B x Γ}
→ A ∈[ x ] Γ
→ A ∈[ suc x ] (Γ , B)
data _⊢_ (Γ : Cx) : Ty → Set where
𝒗_ : ∀{n x A}
→ ⟨ n , A ⟩ ∈[ x ] Γ
→ Γ ⊢ 𝑣[ n ] x ∵ A
𝝀ⁿ_ : ∀{n} {𝐭 : Tms n} {A B}
→ Γ , ⟨ n , A ⟩ ⊢ 𝐭 ∵ B
→ Γ ⊢ 𝜆ⁿ 𝐭 ∵ (A ⊃ B)
_∙ⁿ_ : ∀{n} {𝐭 𝐬 : Tms n} {A B}
→ Γ ⊢ 𝐭 ∵ (A ⊃ B) → Γ ⊢ 𝐬 ∵ A
→ Γ ⊢ 𝐭 ∘ⁿ 𝐬 ∵ B
𝒑ⁿ⟨_,_⟩ : ∀{n} {𝐭 𝐬 : Tms n} {A B}
→ Γ ⊢ 𝐭 ∵ A → Γ ⊢ 𝐬 ∵ B
→ Γ ⊢ 𝑝ⁿ⟨ 𝐭 , 𝐬 ⟩ ∵ (A ∧ B)
𝝅₀ⁿ_ : ∀{n} {𝐭 : Tms n} {A B}
→ Γ ⊢ 𝐭 ∵ (A ∧ B)
→ Γ ⊢ 𝜋₀ⁿ 𝐭 ∵ A
𝝅₁ⁿ_ : ∀{n} {𝐭 : Tms n} {A B}
→ Γ ⊢ 𝐭 ∵ (A ∧ B)
→ Γ ⊢ 𝜋₁ⁿ 𝐭 ∵ B
𝜾₀ⁿ_ : ∀{n} {𝐭 : Tms n} {A B}
→ Γ ⊢ 𝐭 ∵ A
→ Γ ⊢ 𝜄₀ⁿ 𝐭 ∵ (A ∨ B)
𝜾₁ⁿ_ : ∀{n} {𝐭 : Tms n} {A B}
→ Γ ⊢ 𝐭 ∵ B
→ Γ ⊢ 𝜄₁ⁿ 𝐭 ∵ (A ∨ B)
𝒄ⁿ[_▷_∣_] : ∀{n} {𝐭 𝐬 𝐮 : Tms n} {A B C}
→ Γ ⊢ 𝐭 ∵ (A ∨ B) → Γ , ⟨ n , A ⟩ ⊢ 𝐬 ∵ C
→ Γ , ⟨ n , B ⟩ ⊢ 𝐮 ∵ C
→ Γ ⊢ 𝑐ⁿ[ 𝐭 ▷ 𝐬 ∣ 𝐮 ] ∵ C
⬆ⁿ_ : ∀{n} {𝐭 : Tms n} {u A}
→ Γ ⊢ 𝐭 ∵ (u ∶ A)
→ Γ ⊢ ⇑ⁿ 𝐭 ∵ (! u ∶ u ∶ A)
⬇ⁿ_ : ∀{n} {𝐭 : Tms n} {u A}
→ Γ ⊢ 𝐭 ∵ (u ∶ A)
→ Γ ⊢ ⇓ⁿ 𝐭 ∵ A
★ⁿ_ : ∀{n A} {𝐭 : Tms n}
→ Γ ⊢ 𝐭 ∵ ⊥
→ Γ ⊢ ☆ⁿ 𝐭 ∵ A
⊩_ : Ty → Set
⊩ A = ∀{Γ} → Γ ⊢ A
𝟎 : ∀{A Γ}
→ A ∈[ 0 ] (Γ , A)
𝟎 = 𝐙
𝟏 : ∀{A B Γ}
→ A ∈[ 1 ] (Γ , A , B)
𝟏 = 𝐒 𝟎
𝟐 : ∀{A B C Γ}
→ A ∈[ 2 ] (Γ , A , B , C)
𝟐 = 𝐒 𝟏
𝟑 : ∀{A B C D Γ}
→ A ∈[ 3 ] (Γ , A , B , C , D)
𝟑 = 𝐒 𝟐
𝟒 : ∀{A B C D E Γ}
→ A ∈[ 4 ] (Γ , A , B , C , D , E)
𝟒 = 𝐒 𝟑
𝝀_ : ∀{A B Γ}
→ Γ , ⟨ 0 , A ⟩ ⊢ B
→ Γ ⊢ A ⊃ B
𝝀_ = 𝝀ⁿ_ {𝐭 = []}
_∙_ : ∀{A B Γ}
→ Γ ⊢ A ⊃ B → Γ ⊢ A
→ Γ ⊢ B
_∙_ = _∙ⁿ_ {𝐭 = []} {𝐬 = []}
𝒑⟨_,_⟩ : ∀{A B Γ}
→ Γ ⊢ A → Γ ⊢ B
→ Γ ⊢ A ∧ B
𝒑⟨_,_⟩ = 𝒑ⁿ⟨_,_⟩ {𝐭 = []} {𝐬 = []}
𝝅₀_ : ∀{A B Γ}
→ Γ ⊢ A ∧ B
→ Γ ⊢ A
𝝅₀_ = 𝝅₀ⁿ_ {𝐭 = []}
𝝅₁_ : ∀{A B Γ}
→ Γ ⊢ A ∧ B
→ Γ ⊢ B
𝝅₁_ = 𝝅₁ⁿ_ {𝐭 = []}
𝜾₀_ : ∀{A B Γ}
→ Γ ⊢ A
→ Γ ⊢ A ∨ B
𝜾₀_ = 𝜾₀ⁿ_ {𝐭 = []}
𝜾₁_ : ∀{A B Γ}
→ Γ ⊢ B
→ Γ ⊢ A ∨ B
𝜾₁_ = 𝜾₁ⁿ_ {𝐭 = []}
𝒄[_▷_∣_] : ∀{A B C Γ}
→ Γ ⊢ A ∨ B → Γ , ⟨ 0 , A ⟩ ⊢ C
→ Γ , ⟨ 0 , B ⟩ ⊢ C
→ Γ ⊢ C
𝒄[_▷_∣_] = 𝒄ⁿ[_▷_∣_] {𝐭 = []} {𝐬 = []}
{𝐮 = []}
⬆_ : ∀{u A Γ}
→ Γ ⊢ u ∶ A
→ Γ ⊢ ! u ∶ u ∶ A
⬆_ = ⬆ⁿ_ {𝐭 = []}
⬇_ : ∀{u A Γ}
→ Γ ⊢ u ∶ A
→ Γ ⊢ A
⬇_ = ⬇ⁿ_ {𝐭 = []}
★_ : ∀{A Γ}
→ Γ ⊢ ⊥
→ Γ ⊢ A
★_ = ★ⁿ_ {𝐭 = []}
𝝀²_ : ∀{t A B Γ}
→ Γ , ⟨ 1 , A ⟩ ⊢ t ∶ B
→ Γ ⊢ 𝜆 t ∶ (A ⊃ B)
𝝀²_ {t} =
𝝀ⁿ_ {𝐭 = t ∷ []}
_∙²_ : ∀{t s A B Γ}
→ Γ ⊢ t ∶ (A ⊃ B) → Γ ⊢ s ∶ A
→ Γ ⊢ t ∘ s ∶ B
_∙²_ {t} {s} =
_∙ⁿ_ {𝐭 = t ∷ []} {𝐬 = s ∷ []}
𝒑²⟨_,_⟩ : ∀{t s A B Γ}
→ Γ ⊢ t ∶ A → Γ ⊢ s ∶ B
→ Γ ⊢ 𝑝⟨ t , s ⟩ ∶ (A ∧ B)
𝒑²⟨_,_⟩ {t} {s} =
𝒑ⁿ⟨_,_⟩ {𝐭 = t ∷ []} {𝐬 = s ∷ []}
𝝅₀²_ : ∀{t A B Γ}
→ Γ ⊢ t ∶ (A ∧ B)
→ Γ ⊢ 𝜋₀ t ∶ A
𝝅₀²_ {t} =
𝝅₀ⁿ_ {𝐭 = t ∷ []}
𝝅₁²_ : ∀{t A B Γ}
→ Γ ⊢ t ∶ (A ∧ B)
→ Γ ⊢ 𝜋₁ t ∶ B
𝝅₁²_ {t} =
𝝅₁ⁿ_ {𝐭 = t ∷ []}
𝜾₀²_ : ∀{t A B Γ}
→ Γ ⊢ t ∶ A
→ Γ ⊢ 𝜄₀ t ∶ (A ∨ B)
𝜾₀²_ {t} =
𝜾₀ⁿ_ {𝐭 = t ∷ []}
𝜾₁²_ : ∀{t A B Γ}
→ Γ ⊢ t ∶ B
→ Γ ⊢ 𝜄₁ t ∶ (A ∨ B)
𝜾₁²_ {t} =
𝜾₁ⁿ_ {𝐭 = t ∷ []}
𝒄²[_▷_∣_] : ∀{t s u A B C Γ}
→ Γ ⊢ t ∶ (A ∨ B) → Γ , ⟨ 1 , A ⟩ ⊢ s ∶ C
→ Γ , ⟨ 1 , B ⟩ ⊢ u ∶ C
→ Γ ⊢ 𝑐[ t ▷ s ∣ u ] ∶ C
𝒄²[_▷_∣_] {t} {s} {u} =
𝒄ⁿ[_▷_∣_] {𝐭 = t ∷ []} {𝐬 = s ∷ []}
{𝐮 = u ∷ []}
⬆²_ : ∀{t u A Γ}
→ Γ ⊢ t ∶ u ∶ A
→ Γ ⊢ ⇑ t ∶ ! u ∶ u ∶ A
⬆²_ {t} =
⬆ⁿ_ {𝐭 = t ∷ []}
⬇²_ : ∀{t u A Γ}
→ Γ ⊢ t ∶ u ∶ A
→ Γ ⊢ ⇓ t ∶ A
⬇²_ {t} =
⬇ⁿ_ {𝐭 = t ∷ []}
★²_ : ∀{t A Γ}
→ Γ ⊢ t ∶ ⊥
→ Γ ⊢ ☆ t ∶ A
★²_ {t} =
★ⁿ_ {𝐭 = t ∷ []}
𝝀³_ : ∀{t₂ t A B Γ}
→ Γ , ⟨ 2 , A ⟩ ⊢ t₂ ∶ t ∶ B
→ Γ ⊢ 𝜆² t₂ ∶ 𝜆 t ∶ (A ⊃ B)
𝝀³_ {t₂} {t} =
𝝀ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
_∙³_ : ∀{t₂ t s₂ s A B Γ}
→ Γ ⊢ t₂ ∶ t ∶ (A ⊃ B) → Γ ⊢ s₂ ∶ s ∶ A
→ Γ ⊢ t₂ ∘² s₂ ∶ t ∘ s ∶ B
_∙³_ {t₂} {t} {s₂} {s} =
_∙ⁿ_ {𝐭 = t₂ ∷ t ∷ []} {𝐬 = s₂ ∷ s ∷ []}
𝒑³⟨_,_⟩ : ∀{t₂ t s₂ s A B Γ}
→ Γ ⊢ t₂ ∶ t ∶ A → Γ ⊢ s₂ ∶ s ∶ B
→ Γ ⊢ 𝑝²⟨ t₂ , s₂ ⟩ ∶ 𝑝⟨ t , s ⟩ ∶ (A ∧ B)
𝒑³⟨_,_⟩ {t₂} {t} {s₂} {s} =
𝒑ⁿ⟨_,_⟩ {𝐭 = t₂ ∷ t ∷ []} {𝐬 = s₂ ∷ s ∷ []}
𝝅₀³_ : ∀{t₂ t A B Γ}
→ Γ ⊢ t₂ ∶ t ∶ (A ∧ B)
→ Γ ⊢ 𝜋₀² t₂ ∶ 𝜋₀ t ∶ A
𝝅₀³_ {t₂} {t} =
𝝅₀ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
𝝅₁³_ : ∀{t₂ t A B Γ}
→ Γ ⊢ t₂ ∶ t ∶ (A ∧ B)
→ Γ ⊢ 𝜋₁² t₂ ∶ 𝜋₁ t ∶ B
𝝅₁³_ {t₂} {t} =
𝝅₁ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
𝜾₀³_ : ∀{t₂ t A B Γ}
→ Γ ⊢ t₂ ∶ t ∶ A
→ Γ ⊢ 𝜄₀² t₂ ∶ 𝜄₀ t ∶ (A ∨ B)
𝜾₀³_ {t₂} {t} =
𝜾₀ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
𝜾₁³_ : ∀{t₂ t A B Γ}
→ Γ ⊢ t₂ ∶ t ∶ B
→ Γ ⊢ 𝜄₁² t₂ ∶ 𝜄₁ t ∶ (A ∨ B)
𝜾₁³_ {t₂} {t} =
𝜾₁ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
𝒄³[_▷_∣_] : ∀{t₂ t s₂ s u₂ u A B C Γ}
→ Γ ⊢ t₂ ∶ t ∶ (A ∨ B) → Γ , ⟨ 2 , A ⟩ ⊢ s₂ ∶ s ∶ C
→ Γ , ⟨ 2 , B ⟩ ⊢ u₂ ∶ u ∶ C
→ Γ ⊢ 𝑐²[ t₂ ▷ s₂ ∣ u₂ ] ∶ 𝑐[ t ▷ s ∣ u ] ∶ C
𝒄³[_▷_∣_] {t₂} {t} {s₂} {s} {u₂} {u} =
𝒄ⁿ[_▷_∣_] {𝐭 = t₂ ∷ t ∷ []} {𝐬 = s₂ ∷ s ∷ []}
{𝐮 = u₂ ∷ u ∷ []}
⬆³_ : ∀{t₂ t u A Γ}
→ Γ ⊢ t₂ ∶ t ∶ u ∶ A
→ Γ ⊢ ⇑² t₂ ∶ ⇑ t ∶ ! u ∶ u ∶ A
⬆³_ {t₂} {t} =
⬆ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
⬇³_ : ∀{t₂ t u A Γ}
→ Γ ⊢ t₂ ∶ t ∶ u ∶ A
→ Γ ⊢ ⇓² t₂ ∶ ⇓ t ∶ A
⬇³_ {t₂} {t} =
⬇ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
★³_ : ∀{t₂ t A Γ}
→ Γ ⊢ t₂ ∶ t ∶ ⊥
→ Γ ⊢ ☆² t₂ ∶ ☆ t ∶ A
★³_ {t₂} {t} =
★ⁿ_ {𝐭 = t₂ ∷ t ∷ []}
𝝀⁴_ : ∀{t₃ t₂ t A B Γ}
→ Γ , ⟨ 3 , A ⟩ ⊢ t₃ ∶ t₂ ∶ t ∶ B
→ Γ ⊢ 𝜆³ t₃ ∶ 𝜆² t₂ ∶ 𝜆 t ∶ (A ⊃ B)
𝝀⁴_ {t₃} {t₂} {t} =
𝝀ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
_∙⁴_ : ∀{t₃ t₂ t s₃ s₂ s A B Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ (A ⊃ B) → Γ ⊢ s₃ ∶ s₂ ∶ s ∶ A
→ Γ ⊢ t₃ ∘³ s₃ ∶ t₂ ∘² s₂ ∶ t ∘ s ∶ B
_∙⁴_ {t₃} {t₂} {t} {s₃} {s₂} {s} =
_∙ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []} {𝐬 = s₃ ∷ s₂ ∷ s ∷ []}
𝒑⁴⟨_,_⟩ : ∀{t₃ t₂ t s₃ s₂ s A B Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ A → Γ ⊢ s₃ ∶ s₂ ∶ s ∶ B
→ Γ ⊢ 𝑝³⟨ t₃ , s₃ ⟩ ∶ 𝑝²⟨ t₂ , s₂ ⟩ ∶ 𝑝⟨ t , s ⟩ ∶ (A ∧ B)
𝒑⁴⟨_,_⟩ {t₃} {t₂} {t} {s₃} {s₂} {s} =
𝒑ⁿ⟨_,_⟩ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []} {𝐬 = s₃ ∷ s₂ ∷ s ∷ []}
𝝅₀⁴_ : ∀{t₃ t₂ t A B Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ (A ∧ B)
→ Γ ⊢ 𝜋₀³ t₃ ∶ 𝜋₀² t₂ ∶ 𝜋₀ t ∶ A
𝝅₀⁴_ {t₃} {t₂} {t} =
𝝅₀ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
𝝅₁⁴_ : ∀{t₃ t₂ t A B Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ (A ∧ B)
→ Γ ⊢ 𝜋₁³ t₃ ∶ 𝜋₁² t₂ ∶ 𝜋₁ t ∶ B
𝝅₁⁴_ {t₃} {t₂} {t} =
𝝅₁ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
𝜾₀⁴_ : ∀{t₃ t₂ t A B Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ A
→ Γ ⊢ 𝜄₀³ t₃ ∶ 𝜄₀² t₂ ∶ 𝜄₀ t ∶ (A ∨ B)
𝜾₀⁴_ {t₃} {t₂} {t} =
𝜾₀ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
𝜾₁⁴_ : ∀{t₃ t₂ t A B Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ B
→ Γ ⊢ 𝜄₁³ t₃ ∶ 𝜄₁² t₂ ∶ 𝜄₁ t ∶ (A ∨ B)
𝜾₁⁴_ {t₃} {t₂} {t} =
𝜾₁ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
𝒄⁴[_▷_∣_] : ∀{t₃ t₂ t s₃ s₂ s u₃ u₂ u A B C Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ (A ∨ B) → Γ , ⟨ 3 , A ⟩ ⊢ s₃ ∶ s₂ ∶ s ∶ C
→ Γ , ⟨ 3 , B ⟩ ⊢ u₃ ∶ u₂ ∶ u ∶ C
→ Γ ⊢ 𝑐³[ t₃ ▷ s₃ ∣ u₃ ] ∶ 𝑐²[ t₂ ▷ s₂ ∣ u₂ ] ∶ 𝑐[ t ▷ s ∣ u ] ∶ C
𝒄⁴[_▷_∣_] {t₃} {t₂} {t} {s₃} {s₂} {s} {u₃} {u₂} {u} =
𝒄ⁿ[_▷_∣_] {𝐭 = t₃ ∷ t₂ ∷ t ∷ []} {𝐬 = s₃ ∷ s₂ ∷ s ∷ []}
{𝐮 = u₃ ∷ u₂ ∷ u ∷ []}
⬆⁴_ : ∀{t₃ t₂ t u A Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ u ∶ A
→ Γ ⊢ ⇑³ t₃ ∶ ⇑² t₂ ∶ ⇑ t ∶ ! u ∶ u ∶ A
⬆⁴_ {t₃} {t₂} {t} =
⬆ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
⬇⁴_ : ∀{t₃ t₂ t u A Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ u ∶ A
→ Γ ⊢ ⇓³ t₃ ∶ ⇓² t₂ ∶ ⇓ t ∶ A
⬇⁴_ {t₃} {t₂} {t} =
⬇ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
★⁴_ : ∀{t₃ t₂ t A Γ}
→ Γ ⊢ t₃ ∶ t₂ ∶ t ∶ ⊥
→ Γ ⊢ ☆³ t₃ ∶ ☆² t₂ ∶ ☆ t ∶ A
★⁴_ {t₃} {t₂} {t} =
★ⁿ_ {𝐭 = t₃ ∷ t₂ ∷ t ∷ []}
quot : ∀{B Γ} → Γ ⊢ B → Tm
quot (𝒗_ {x = x} i) = 𝑣 x
quot (𝝀ⁿ_ {n} 𝒟) = 𝜆[ suc n ] quot 𝒟
quot (_∙ⁿ_ {n} 𝒟 𝒞) = quot 𝒟 ∘[ suc n ] quot 𝒞
quot (𝒑ⁿ⟨_,_⟩ {n} 𝒟 𝒞) = 𝑝[ suc n ]⟨ quot 𝒟 , quot 𝒞 ⟩
quot (𝝅₀ⁿ_ {n} 𝒟) = 𝜋₀[ suc n ] quot 𝒟
quot (𝝅₁ⁿ_ {n} 𝒟) = 𝜋₁[ suc n ] quot 𝒟
quot (𝜾₀ⁿ_ {n} 𝒟) = 𝜄₀[ suc n ] quot 𝒟
quot (𝜾₁ⁿ_ {n} 𝒟) = 𝜄₁[ suc n ] quot 𝒟
quot (𝒄ⁿ[_▷_∣_] {n} 𝒟 𝒞 ℰ) = 𝑐[ suc n ][ quot 𝒟 ▷ quot 𝒞 ∣ quot ℰ ]
quot (⬆ⁿ_ {n} 𝒟) = ⇑[ suc n ] quot 𝒟
quot (⬇ⁿ_ {n} 𝒟) = ⇓[ suc n ] quot 𝒟
quot (★ⁿ_ {n} 𝒟) = ☆[ suc n ] quot 𝒟
prefix : Cx → Cx
prefix ∅ = ∅
prefix (Γ , ⟨ n , A ⟩) = prefix Γ , ⟨ suc n , A ⟩
int∈ : ∀{n x A Γ}
→ ⟨ n , A ⟩ ∈[ x ] Γ
→ ⟨ suc n , A ⟩ ∈[ x ] prefix Γ
int∈ 𝐙 = 𝐙
int∈ (𝐒 i) = 𝐒 (int∈ i)
int⊢ : ∀{B Γ}
→ (𝒟 : Γ ⊢ B)
→ prefix Γ ⊢ quot 𝒟 ∶ B
int⊢ (𝒗 i) = 𝒗 int∈ i
int⊢ (𝝀ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝝀ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
int⊢ (_∙ⁿ_ {𝐭 = 𝐭} {𝐬 = 𝐬} 𝒟 𝒞) =
_∙ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} {𝐬 = quot 𝒞 ∷ 𝐬} (int⊢ 𝒟) (int⊢ 𝒞)
int⊢ (𝒑ⁿ⟨_,_⟩ {𝐭 = 𝐭} {𝐬 = 𝐬} 𝒟 𝒞) =
𝒑ⁿ⟨_,_⟩ {𝐭 = quot 𝒟 ∷ 𝐭} {𝐬 = quot 𝒞 ∷ 𝐬} (int⊢ 𝒟) (int⊢ 𝒞)
int⊢ (𝝅₀ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝝅₀ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
int⊢ (𝝅₁ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝝅₁ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
int⊢ (𝜾₀ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝜾₀ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
int⊢ (𝜾₁ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝜾₁ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
int⊢ (𝒄ⁿ[_▷_∣_] {𝐭 = 𝐭} {𝐬 = 𝐬} {𝐮 = 𝐮} 𝒟 𝒞 ℰ) =
𝒄ⁿ[_▷_∣_] {𝐭 = quot 𝒟 ∷ 𝐭} {𝐬 = quot 𝒞 ∷ 𝐬}
{𝐮 = quot ℰ ∷ 𝐮} (int⊢ 𝒟) (int⊢ 𝒞)
(int⊢ ℰ)
int⊢ (⬆ⁿ_ {𝐭 = 𝐭} 𝒟) = ⬆ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
int⊢ (⬇ⁿ_ {𝐭 = 𝐭} 𝒟) = ⬇ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
int⊢ (★ⁿ_ {𝐭 = 𝐭} 𝒟) = ★ⁿ_ {𝐭 = quot 𝒟 ∷ 𝐭} (int⊢ 𝒟)
wk∈ : ∀{x A Δ}
→ (Γ : Cx) → A ∈[ x ] (∅ „ Γ)
→ A ∈[ x ] (Δ „ Γ)
wk∈ ∅ ()
wk∈ (Γ , A) 𝐙 = 𝐙
wk∈ (Γ , A) (𝐒 i) = 𝐒 (wk∈ Γ i)
wk⊢ : ∀{A Δ}
→ (Γ : Cx) → ∅ „ Γ ⊢ A
→ Δ „ Γ ⊢ A
wk⊢ Γ (𝒗 i) = 𝒗 wk∈ Γ i
wk⊢ Γ (𝝀ⁿ_ {n} {𝐭} {A} 𝒟) = 𝝀ⁿ_ {𝐭 = 𝐭} (wk⊢ (Γ , ⟨ n , A ⟩) 𝒟)
wk⊢ Γ (_∙ⁿ_ {𝐭 = 𝐭} {𝐬 = 𝐬} 𝒟 𝒞) =
_∙ⁿ_ {𝐭 = 𝐭} {𝐬 = 𝐬} (wk⊢ Γ 𝒟) (wk⊢ Γ 𝒞)
wk⊢ Γ (𝒑ⁿ⟨_,_⟩ {𝐭 = 𝐭} {𝐬 = 𝐬} 𝒟 𝒞) =
𝒑ⁿ⟨_,_⟩ {𝐭 = 𝐭} {𝐬 = 𝐬} (wk⊢ Γ 𝒟) (wk⊢ Γ 𝒞)
wk⊢ Γ (𝝅₀ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝝅₀ⁿ_ {𝐭 = 𝐭} (wk⊢ Γ 𝒟)
wk⊢ Γ (𝝅₁ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝝅₁ⁿ_ {𝐭 = 𝐭} (wk⊢ Γ 𝒟)
wk⊢ Γ (𝜾₀ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝜾₀ⁿ_ {𝐭 = 𝐭} (wk⊢ Γ 𝒟)
wk⊢ Γ (𝜾₁ⁿ_ {𝐭 = 𝐭} 𝒟) = 𝜾₁ⁿ_ {𝐭 = 𝐭} (wk⊢ Γ 𝒟)
wk⊢ Γ (𝒄ⁿ[_▷_∣_] {n} {𝐭} {𝐬} {𝐮} {A} {B} 𝒟 𝒞 ℰ) =
𝒄ⁿ[_▷_∣_] {𝐭 = 𝐭} {𝐬 = 𝐬}
{𝐮 = 𝐮} (wk⊢ Γ 𝒟) (wk⊢ (Γ , ⟨ n , A ⟩) 𝒞)
(wk⊢ (Γ , ⟨ n , B ⟩) ℰ)
wk⊢ Γ (⬆ⁿ_ {𝐭 = 𝐭} 𝒟) = ⬆ⁿ_ {𝐭 = 𝐭} (wk⊢ Γ 𝒟)
wk⊢ Γ (⬇ⁿ_ {𝐭 = 𝐭} 𝒟) = ⬇ⁿ_ {𝐭 = 𝐭} (wk⊢ Γ 𝒟)
wk⊢ Γ (★ⁿ_ {𝐭 = 𝐭} 𝒟) = ★ⁿ_ {𝐭 = 𝐭} (wk⊢ Γ 𝒟)
nec : ∀{A}
→ (𝒟 : ∅ ⊢ A)
→ ⊩ quot 𝒟 ∶ A
nec 𝒟 = wk⊢ ∅ (int⊢ 𝒟)
module PL where
I : ∀{A}
→ ⊩ A ⊃ A
I = 𝝀 𝒗 𝟎
K : ∀{A B}
→ ⊩ A ⊃ B ⊃ A
K = 𝝀 𝝀 𝒗 𝟏
S : ∀{A B C}
→ ⊩ (A ⊃ B ⊃ C) ⊃ (A ⊃ B) ⊃ A ⊃ C
S = 𝝀 𝝀 𝝀 (𝒗 𝟐 ∙ 𝒗 𝟎) ∙ (𝒗 𝟏 ∙ 𝒗 𝟎)
X1 : ∀{A B}
→ ⊩ A ⊃ B ⊃ A ∧ B
X1 = 𝝀 𝝀 𝒑⟨ 𝒗 𝟏 , 𝒗 𝟎 ⟩
module PLExamples where
I² : ∀{A}
→ ⊩ 𝜆 𝑣 0 ∶ (A ⊃ A)
I² = nec PL.I
I³ : ∀{A}
→ ⊩ 𝜆² 𝑣 0 ∶ 𝜆 𝑣 0 ∶ (A ⊃ A)
I³ = nec I²
K² : ∀{A B}
→ ⊩ 𝜆 𝜆 𝑣 1 ∶ (A ⊃ B ⊃ A)
K² = nec PL.K
K³ : ∀{A B}
→ ⊩ 𝜆² 𝜆² 𝑣 1 ∶ 𝜆 𝜆 𝑣 1 ∶ (A ⊃ B ⊃ A)
K³ = nec K²
S² : ∀{A B C}
→ ⊩ 𝜆 𝜆 𝜆 (𝑣 2 ∘ 𝑣 0) ∘ (𝑣 1 ∘ 𝑣 0)
∶ ((A ⊃ B ⊃ C) ⊃ (A ⊃ B) ⊃ A ⊃ C)
S² = nec PL.S
S³ : ∀{A B C}
→ ⊩ 𝜆² 𝜆² 𝜆² (𝑣 2 ∘² 𝑣 0) ∘² (𝑣 1 ∘² 𝑣 0)
∶ 𝜆 𝜆 𝜆 (𝑣 2 ∘ 𝑣 0) ∘ (𝑣 1 ∘ 𝑣 0)
∶ ((A ⊃ B ⊃ C) ⊃ (A ⊃ B) ⊃ A ⊃ C)
S³ = nec S²
module S4 where
K : ∀{f x A B}
→ ⊩ (f ∶ (A ⊃ B)) ⊃ x ∶ A ⊃ (f ∘ x) ∶ B
K = 𝝀 𝝀 (𝒗 𝟏 ∙² 𝒗 𝟎)
T : ∀{x A}
→ ⊩ x ∶ A ⊃ A
T = 𝝀 ⬇ 𝒗 𝟎
#4 : ∀{x A}
→ ⊩ x ∶ A ⊃ ! x ∶ x ∶ A
#4 = 𝝀 ⬆ 𝒗 𝟎
X1 : ∀{x y A B}
→ ⊩ x ∶ A ⊃ y ∶ B ⊃ ! 𝑝⟨ x , y ⟩ ∶ 𝑝⟨ x , y ⟩ ∶ (A ∧ B)
X1 = 𝝀 𝝀 ⬆ 𝒑²⟨ 𝒗 𝟏 , 𝒗 𝟎 ⟩
X2 : ∀{x y A B}
→ ⊩ x ∶ A ⊃ y ∶ B ⊃ 𝑝⟨ x , y ⟩ ∶ (A ∧ B)
X2 = 𝝀 𝝀 𝒑²⟨ 𝒗 𝟏 , 𝒗 𝟎 ⟩
X3 : ∀{x y A B}
→ ⊩ x ∶ A ∧ y ∶ B ⊃ ! 𝑝⟨ x , y ⟩ ∶ 𝑝⟨ x , y ⟩ ∶ (A ∧ B)
X3 = 𝝀 ⬆ 𝒑²⟨ 𝝅₀ 𝒗 𝟎 , 𝝅₁ 𝒗 𝟎 ⟩
X4 : ∀{x y A B}
→ ⊩ x ∶ A ∧ y ∶ B ⊃ 𝑝⟨ x , y ⟩ ∶ (A ∧ B)
X4 = 𝝀 𝒑²⟨ 𝝅₀ 𝒗 𝟎 , 𝝅₁ 𝒗 𝟎 ⟩
module S4Examples where
K² : ∀{f x A B}
→ ⊩ 𝜆 𝜆 𝑣 1 ∘² 𝑣 0 ∶ (f ∶ (A ⊃ B) ⊃ x ∶ A ⊃ (f ∘ x) ∶ B)
K² = nec S4.K
module Example1 where
E11 : ∀{x A}
→ ⊩ 𝜆 ⇓ 𝑣 0 ∶ (x ∶ A ⊃ A)
E11 = nec S4.T
E12 : ∀{x A}
→ ⊩ 𝜆 ⇑ 𝑣 0 ∶ (x ∶ A ⊃ ! x ∶ x ∶ A)
E12 = nec S4.#4
E13 : ∀{A B}
→ ⊩ 𝜆² 𝜆² 𝑝²⟨ 𝑣 1 , 𝑣 0 ⟩ ∶ 𝜆 𝜆 𝑝⟨ 𝑣 1 , 𝑣 0 ⟩ ∶ (A ⊃ B ⊃ A ∧ B)
E13 = nec (nec PL.X1)
E14 : ∀{x y A B}
→ ⊩ 𝜆 𝜆 ⇑ 𝑝²⟨ 𝑣 1 , 𝑣 0 ⟩
∶ (x ∶ A ⊃ y ∶ B ⊃ ! 𝑝⟨ x , y ⟩ ∶ 𝑝⟨ x , y ⟩ ∶ (A ∧ B))
E14 = nec S4.X1
module Example1a where
E14a : ∀{x y A B}
→ ⊩ 𝜆 𝜆 𝑝²⟨ 𝑣 1 , 𝑣 0 ⟩ ∶ (x ∶ A ⊃ y ∶ B ⊃ 𝑝⟨ x , y ⟩ ∶ (A ∧ B))
E14a = nec S4.X2
E14c : ∀{x y A B}
→ ⊩ 𝜆 ⇑ 𝑝²⟨ 𝜋₀ 𝑣 0 , 𝜋₁ 𝑣 0 ⟩
∶ (x ∶ A ∧ y ∶ B ⊃ ! 𝑝⟨ x , y ⟩ ∶ 𝑝⟨ x , y ⟩ ∶ (A ∧ B))
E14c = nec S4.X3
E14b : ∀{x y A B}
→ ⊩ 𝜆 𝑝²⟨ 𝜋₀ 𝑣 0 , 𝜋₁ 𝑣 0 ⟩ ∶ (x ∶ A ∧ y ∶ B ⊃ 𝑝⟨ x , y ⟩ ∶ (A ∧ B))
E14b = nec S4.X4
module Example2 where
E2 : ∀{x A}
→ ⊩ 𝜆² ⇓² ⇑² 𝑣 0 ∶ 𝜆 ⇓ ⇑ 𝑣 0 ∶ (x ∶ A ⊃ x ∶ A)
E2 = 𝝀³ ⬇³ ⬆³ 𝒗 𝟎
E2a : ∀{x A}
→ ⊩ 𝜆² 𝑣 0 ∶ 𝜆 𝑣 0 ∶ (x ∶ A ⊃ x ∶ A)
E2a = 𝝀³ 𝒗 𝟎
module DeMorgan where
L1 : ∀{A B}
→ ⊩ ¬ A ∧ ¬ B ⫗ ¬ (A ∨ B)
L1 = 𝒑⟨ 𝝀 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝝅₀ 𝒗 𝟐 ∙ 𝒗 𝟎 ∣ 𝝅₁ 𝒗 𝟐 ∙ 𝒗 𝟎 ]
, 𝝀 𝒑⟨ 𝝀 𝒗 𝟏 ∙ 𝜾₀ 𝒗 𝟎 , 𝝀 𝒗 𝟏 ∙ 𝜾₁ 𝒗 𝟎 ⟩ ⟩
L2 : ∀{A B}
→ ⊩ ¬ A ∨ ¬ B ⊃ ¬ (A ∧ B)
L2 = 𝝀 𝝀 𝒄[ 𝒗 𝟏 ▷ 𝒗 𝟎 ∙ 𝝅₀ 𝒗 𝟏 ∣ 𝒗 𝟎 ∙ 𝝅₁ 𝒗 𝟏 ]
module ExploCon where
X1 : ∀{A}
→ ⊩ ⊥ ⊃ A
X1 = 𝝀 ★ 𝒗 𝟎
X1² : ∀{A}
→ ⊩ 𝜆 ☆ 𝑣 0 ∶ (⊥ ⊃ A)
X1² = nec X1
X2 : ∀{x A}
→ ⊩ x ∶ ⊥ ⊃ ☆ x ∶ A
X2 = 𝝀 ★² 𝒗 𝟎
X3 : ∀{A}
→ ⊩ ¬ A ⊃ A ⊃ ⊥
X3 = 𝝀 𝝀 𝒗 𝟏 ∙ 𝒗 𝟎
X4 : ∀{x y A}
→ ⊩ x ∶ (¬ A) ⊃ y ∶ A ⊃ x ∘ y ∶ ⊥
X4 = 𝝀 𝝀 𝒗 𝟏 ∙² 𝒗 𝟎
X5 : ∀{x y A}
→ ⊩ x ∶ (¬ A) ⊃ y ∶ A ⊃ ! (x ∘ y) ∶ x ∘ y ∶ ⊥
X5 = 𝝀 𝝀 ⬆ 𝒗 𝟏 ∙² 𝒗 𝟎
module Idempotence where
⊃-idem : ∀{A}
→ ⊩ A ⊃ A ⫗ ⊤
⊃-idem = 𝒑⟨ 𝝀 𝝀 𝒗 𝟎
, 𝝀 𝝀 𝒗 𝟎 ⟩
∧-idem : ∀{A}
→ ⊩ A ∧ A ⫗ A
∧-idem = 𝒑⟨ 𝝀 𝝅₀ 𝒗 𝟎
, 𝝀 𝒑⟨ 𝒗 𝟎 , 𝒗 𝟎 ⟩ ⟩
∨-idem : ∀{A}
→ ⊩ A ∨ A ⫗ A
∨-idem = 𝒑⟨ 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝒗 𝟎 ∣ 𝒗 𝟎 ]
, 𝝀 𝜾₀ 𝒗 𝟎 ⟩
module Commutativity where
∧-comm : ∀{A B}
→ ⊩ A ∧ B ⫗ B ∧ A
∧-comm = 𝒑⟨ 𝝀 𝒑⟨ 𝝅₁ 𝒗 𝟎 , 𝝅₀ 𝒗 𝟎 ⟩
, 𝝀 𝒑⟨ 𝝅₁ 𝒗 𝟎 , 𝝅₀ 𝒗 𝟎 ⟩ ⟩
∨-comm : ∀{A B}
→ ⊩ A ∨ B ⫗ B ∨ A
∨-comm = 𝒑⟨ 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝜾₁ 𝒗 𝟎 ∣ 𝜾₀ 𝒗 𝟎 ]
, 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝜾₁ 𝒗 𝟎 ∣ 𝜾₀ 𝒗 𝟎 ] ⟩
module Associativity where
∧-assoc : ∀{A B C}
→ ⊩ A ∧ (B ∧ C) ⫗ (A ∧ B) ∧ C
∧-assoc = 𝒑⟨ 𝝀 𝒑⟨ 𝒑⟨ 𝝅₀ 𝒗 𝟎 , 𝝅₀ 𝝅₁ 𝒗 𝟎 ⟩ , 𝝅₁ 𝝅₁ 𝒗 𝟎 ⟩
, 𝝀 𝒑⟨ 𝝅₀ 𝝅₀ 𝒗 𝟎 , 𝒑⟨ 𝝅₁ 𝝅₀ 𝒗 𝟎 , 𝝅₁ 𝒗 𝟎 ⟩ ⟩ ⟩
∨-assoc : ∀{A B C}
→ ⊩ A ∨ (B ∨ C) ⫗ (A ∨ B) ∨ C
∨-assoc = 𝒑⟨ 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝜾₀ 𝜾₀ 𝒗 𝟎 ∣ 𝒄[ 𝒗 𝟎 ▷ 𝜾₀ 𝜾₁ 𝒗 𝟎 ∣ 𝜾₁ 𝒗 𝟎 ] ]
, 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝒄[ 𝒗 𝟎 ▷ 𝜾₀ 𝒗 𝟎 ∣ 𝜾₁ 𝜾₀ 𝒗 𝟎 ] ∣ 𝜾₁ 𝜾₁ 𝒗 𝟎 ] ⟩
module Distributivity where
⊃-dist-∧ : ∀{A B C}
→ ⊩ A ⊃ (B ∧ C) ⫗ (A ⊃ B) ∧ (A ⊃ C)
⊃-dist-∧ = 𝒑⟨ 𝝀 𝒑⟨ 𝝀 𝝅₀ (𝒗 𝟏 ∙ 𝒗 𝟎) , 𝝀 𝝅₁ (𝒗 𝟏 ∙ 𝒗 𝟎) ⟩
, 𝝀 𝝀 𝒑⟨ 𝝅₀ 𝒗 𝟏 ∙ 𝒗 𝟎 , 𝝅₁ 𝒗 𝟏 ∙ 𝒗 𝟎 ⟩ ⟩
∧-dist-∨ : ∀{A B C}
→ ⊩ A ∧ (B ∨ C) ⫗ (A ∧ B) ∨ (A ∧ C)
∧-dist-∨ = 𝒑⟨ 𝝀 𝒄[ 𝝅₁ 𝒗 𝟎 ▷ 𝜾₀ 𝒑⟨ 𝝅₀ 𝒗 𝟏 , 𝒗 𝟎 ⟩ ∣ 𝜾₁ 𝒑⟨ 𝝅₀ 𝒗 𝟏 , 𝒗 𝟎 ⟩ ]
, 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝒑⟨ 𝝅₀ 𝒗 𝟎 , 𝜾₀ 𝝅₁ 𝒗 𝟎 ⟩ ∣ 𝒑⟨ 𝝅₀ 𝒗 𝟎 , 𝜾₁ 𝝅₁ 𝒗 𝟎 ⟩ ] ⟩
∨-dist-∧ : ∀{A B C}
→ ⊩ A ∨ (B ∧ C) ⫗ (A ∨ B) ∧ (A ∨ C)
∨-dist-∧ = 𝒑⟨ 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝒑⟨ 𝜾₀ 𝒗 𝟎 , 𝜾₀ 𝒗 𝟎 ⟩ ∣ 𝒑⟨ 𝜾₁ 𝝅₀ 𝒗 𝟎 , 𝜾₁ 𝝅₁ 𝒗 𝟎 ⟩ ]
, 𝝀 𝒄[ 𝝅₀ 𝒗 𝟎 ▷ 𝜾₀ 𝒗 𝟎 ∣ 𝒄[ 𝝅₁ 𝒗 𝟏 ▷ 𝜾₀ 𝒗 𝟎 ∣ 𝜾₁ 𝒑⟨ 𝒗 𝟏 , 𝒗 𝟎 ⟩ ] ] ⟩
module Untitled where
⊃-law : ∀{A B C}
→ ⊩ (A ⊃ B) ⊃ (B ⊃ C) ⊃ A ⊃ C
⊃-law = 𝝀 𝝀 𝝀 𝒗 𝟏 ∙ (𝒗 𝟐 ∙ 𝒗 𝟎)
⊃-∧-law : ∀{A B C}
→ ⊩ A ⊃ B ⊃ C ⫗ (A ∧ B) ⊃ C
⊃-∧-law = 𝒑⟨ 𝝀 𝝀 𝒗 𝟏 ∙ 𝝅₀ 𝒗 𝟎 ∙ 𝝅₁ 𝒗 𝟎
, 𝝀 𝝀 𝝀 𝒗 𝟐 ∙ 𝒑⟨ 𝒗 𝟏 , 𝒗 𝟎 ⟩ ⟩
∨-⊃-∧-law : ∀{A B C}
→ ⊩ (A ∨ B) ⊃ C ⫗ (A ⊃ C) ∧ (B ⊃ C)
∨-⊃-∧-law = 𝒑⟨ 𝝀 𝒑⟨ 𝝀 𝒗 𝟏 ∙ 𝜾₀ 𝒗 𝟎 , 𝝀 𝒗 𝟏 ∙ 𝜾₁ 𝒗 𝟎 ⟩
, 𝝀 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝝅₀ 𝒗 𝟐 ∙ 𝒗 𝟎 ∣ 𝝅₁ 𝒗 𝟐 ∙ 𝒗 𝟎 ] ⟩
module Trivial where
⊃-⊤-law : ∀{A}
→ ⊩ A ⊃ ⊤ ⫗ ⊤
⊃-⊤-law = 𝒑⟨ 𝝀 𝝀 𝒗 𝟎
, 𝝀 𝝀 𝒗 𝟏 ⟩
⊤-⊃-law : ∀{A}
→ ⊩ ⊤ ⊃ A ⫗ A
⊤-⊃-law = 𝒑⟨ 𝝀 𝒗 𝟎 ∙ (𝝀 𝒗 𝟎)
, 𝝀 𝝀 𝒗 𝟏 ⟩
⊥-⊃-⊤-law : ∀{A}
→ ⊩ ⊥ ⊃ A ⫗ ⊤
⊥-⊃-⊤-law = 𝒑⟨ 𝝀 𝝀 𝒗 𝟎
, 𝝀 𝝀 ★ 𝒗 𝟎 ⟩
∧-⊥-law : ∀{A}
→ ⊩ A ∧ ⊥ ⫗ ⊥
∧-⊥-law = 𝒑⟨ 𝝀 𝝅₁ 𝒗 𝟎
, 𝝀 ★ 𝒗 𝟎 ⟩
∨-⊥-law : ∀{A}
→ ⊩ A ∨ ⊥ ⫗ A
∨-⊥-law = 𝒑⟨ 𝝀 𝒄[ 𝒗 𝟎 ▷ 𝒗 𝟎 ∣ ★ 𝒗 𝟎 ]
, 𝝀 𝜾₀ 𝒗 𝟎 ⟩
∧-⊤-law : ∀{A}
→ ⊩ A ∧ ⊤ ⫗ A
∧-⊤-law = 𝒑⟨ 𝝀 𝝅₀ 𝒗 𝟎
, 𝝀 𝒑⟨ 𝒗 𝟎 , 𝝀 𝒗 𝟎 ⟩ ⟩
∨-⊤-law : ∀{A}
→ ⊩ A ∨ ⊤ ⫗ ⊤
∨-⊤-law = 𝒑⟨ 𝝀 𝝀 𝒗 𝟎
, 𝝀 𝜾₁ 𝒗 𝟎 ⟩