Files
Julius FischerandClaude Opus 5.5 5d83754d18
Typecheck / agda (push) Successful in 2m22s
True and False, with ex falso; False is empty in the model
True is the unit type (`True = `Unit, `trivial = `tt). `False : Set has
no introduction form; `absurd P e : P for e : False never reduces at the
root (neutral when e is). Covered through level equality, confluence,
the level normaliser, subject reduction, progress, decidability and
strong normalisation (members of False are terms reducing to a neutral
term). The set-theory interface gains an empty set, which False denotes;
Model/Consistency proves no-False.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
2026-11-22 23:11:57 +01:00

70 lines
2.6 KiB
Agda
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
open import univTypes.Model.SetTheory using (SetTheory)
module univTypes.Model.Consistency (S : SetTheory) where
open import Data.Empty using (⊥)
open import Data.Nat using (zero; suc)
open import Data.Fin using (Fin; zero)
open import Data.Product using (proj₁; proj₂) renaming (_,_ to ⟨_,_⟩)
open import Data.Unit using (tt)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; cong; subst)
open import Relation.Nullary using (¬_)
open import univTypes.Specification
open import univTypes.Metatheory.Confluence.Conversion using (≈-sym)
open import univTypes.Model.SetTheory using (fin)
open SetTheory S
open import univTypes.Model.Interpretation S
open import univTypes.Model.Conversion S
open import univTypes.Model.Soundness S
-- Consistency, relative to the set theory S: closed terms of empty types do
-- not exist. With ZFC and ω·2 inaccessibles as S, the type theory is
-- consistent if that set theory is.
private
ρ₀ : Env 0
ρ₀ ()
ρ₀⊨ : ρ₀ ⊨ᶜ ∅
ρ₀⊨ = env λ ()
∅≃ : ∅ ≃ᶜ ∅
∅≃ = ctx≃ λ ()
0≢1 : fromℕ 0 ≡ fromℕ 1 → ⊥
0≢1 p with trans (sym (toℕ-fromℕ 0)) (trans (cong toℕ p) (toℕ-fromℕ 1))
... | ()
-- False has no closed member (True = Unit has tt).
no-False : ∀ {e : Term 0} → ¬ (∅ ⊢ e ⦂ `False)
no-False d = asFalse (sound ∅≃ d) ρ₀ ρ₀⊨
-- No closed proof of zero ≡ suc zero.
no-0≡1 : ∀ {e : Term 0} → ¬ (∅ ⊢ e ⦂ `zero `≡ `suc `zero)
no-0≡1 d with IsId.okId (asId (sound ∅≃ d)) ρ₀ ρ₀⊨
... | ⟨ _ , ⟨ wa , ⟨ wb , m ⟩ ⟩ ⟩ =
0≢1 (trans (sym a≡0) (trans (Id-elim m) b≡1))
where
module E = IsId (asId (sound ∅≃ d))
a≡0 : ⟦ E.a₁ ⟧ ρ₀ ≡ fromℕ 0
a≡0 = ≈-sem (≈-sym E.a≈) wa tt
b≡1 : ⟦ E.b₁ ⟧ ρ₀ ≡ fromℕ 1
b≡1 = trans (≈-sem (≈-sym E.b≈) wb ⟨ tt , fromℕ-∈ ⟩)
(cong (λ k → fromℕ (suc k)) (toℕ-fromℕ 0))
-- No closed term of ∀ (A : Set) → A: it would inhabit an empty set.
no-∀A→A : ∀ {f : Term 0} → ¬ (∅ ⊢ f ⦂ ∀[x⦂ `Set ] ` zero)
no-∀A→A {f = f} d with IsΠ.okΠ (asΠ (sound ∅≃ d)) ρ₀ ρ₀⊨
... | ⟨ _ , ⟨ wA , ⟨ wB , m ⟩ ⟩ ⟩ = 0≢1 (Id-elim (subst (app (⟦ f ⟧ ρ₀) E ∈_) B≡E (app-∈ m E∈)))
where
module P = IsΠ (asΠ (sound ∅≃ d))
E : V
E = Id (fromℕ 0) (fromℕ 1)
A≡U : ⟦ P.A₁ ⟧ ρ₀ ≡ U (fin 0)
A≡U = ≈-sem (≈-sym P.A≈) wA tt
E∈ : E ∈ ⟦ P.A₁ ⟧ ρ₀
E∈ = subst (E ∈_) (sym A≡U) Id-U
B≡E : ⟦ P.B₁ ⟧ (ρ₀ ▹ E) ≡ E
B≡E = ≈-sem (≈-sym P.B≈) (wB E∈) tt