{-# OPTIONS --postfix-projections #-}
{-# OPTIONS --rewriting #-}
open import Data.Bool.Base
open import Library
import SimpleTypes
import STLCDefinable
module NotNotDefinable where
data Base : Set where
bool : Base
B⦅_⦆ : Base → Set
B⦅ bool ⦆ = Bool
open SimpleTypes Base B⦅_⦆
data Const : Set where
true : Const
false : Const
ty : Const → Ty
ty true = base bool
ty false = base bool
c⦅_⦆ : (c : Const) → T⦅ ty c ⦆
c⦅ true ⦆ = true
c⦅ false ⦆ = false
open STLCDefinable Base B⦅_⦆ Const ty c⦅_⦆
data IsConstantOrProjection Γ T (f : Fun Γ T) : Set where
isConstant : (eq : ∀ γ γ' → f γ ≡ f γ') → IsConstantOrProjection Γ T f
isProjection : (x : Var T Γ) (eq : f ≡ V⦅ x ⦆) → IsConstantOrProjection Γ T f
not′ : Fun (ε ▷ base bool) (base bool)
not′ = not ∘′ proj₂
notNotConstantOrProjection : IsConstantOrProjection (ε ▷ base bool) (base bool) not′ → ⊥
notNotConstantOrProjection (isConstant eq) = case eq (_ , true) (_ , false) of λ()
notNotConstantOrProjection (isProjection vz eq) = case cong (λ z → z (_ , true)) eq of λ()
notNotConstantOrProjection (isProjection (STLCDefinable.vs ()) eq)
NN-Base : STLC-KLP-Base
NN-Base .STLCDefinable.STLC-KLP-Base.B⟦_⟧ bool Γ f = IsConstantOrProjection Γ _ f
NN-Base .STLCDefinable.STLC-KLP-Base.monB bool τ (isConstant eq) =
isConstant (λ γ γ' → eq (R⦅ τ ⦆ γ) (R⦅ τ ⦆ γ'))
NN-Base .STLCDefinable.STLC-KLP-Base.monB bool τ (isProjection x refl) =
isProjection (x w[ τ ]ᵛ) (sym (wk-evalv x τ))
NN : STLC-KLP
NN .STLCDefinable.STLC-KLP.klp-base = NN-Base
NN .STLCDefinable.STLC-KLP.satC true = isConstant (λ _ _ → refl)
NN .STLCDefinable.STLC-KLP.satC false = isConstant (λ _ _ → refl)
thm : STLC-definable (ε ▷ base bool) (base bool) not′ → ⊥
thm def = notNotConstantOrProjection (def NN)