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

95 lines
4.3 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.
module univTypes.Decidability.LogRel.Lift where
open import Data.Product using (Σ; _×_) renaming (_,_ to ⟨_,_⟩)
open import univTypes.Specification
open import univTypes.Metatheory.Confluence.Conversion using (≈-sym; ≈-trans)
open import univTypes.Decidability.SN.Properties using (idᵣ)
open import univTypes.Decidability.LogRel.Core
-- Cumulativity of the relation: an embedding of the universes of one kit
-- into another (with the same members) lifts every reducible type, with the
-- same members. Used to move reducible types up the strata.
record KitEmb (K₁ K₂ : Kit) : Set where
private
module K₁ = Kit K₁
module K₂ = Kit K₂
field
emb : ∀ {n} {U : Term n} → K₁.Univ U → K₂.Univ U
to : ∀ {n} {U e : Term n} (u : K₁.Univ U) → K₁._∋ᵁ_ u e → K₂._∋ᵁ_ (emb u) e
from : ∀ {n} {U e : Term n} (u : K₁.Univ U) → K₂._∋ᵁ_ (emb u) e → K₁._∋ᵁ_ u e
-- Embeddings compose.
_∘ᴱ_ : ∀ {K₁ K₂ K₃} → KitEmb K₂ K₃ → KitEmb K₁ K₂ → KitEmb K₁ K₃
E₂ ∘ᴱ E₁ = record
{ emb = λ u → KitEmb.emb E₂ (KitEmb.emb E₁ u)
; to = λ u x → KitEmb.to E₂ (KitEmb.emb E₁ u) (KitEmb.to E₁ u x)
; from = λ u x → KitEmb.from E₁ u (KitEmb.from E₂ (KitEmb.emb E₁ u) x)
}
idᴱ : ∀ {K} → KitEmb K K
idᴱ = record { emb = λ u → u ; to = λ u x → x ; from = λ u x → x }
module Lift {K₁ K₂ : Kit} (E : KitEmb K₁ K₂) (L₁ : KitLaws K₁) where
open KitEmb E
private
module R₁ = LogRel K₁
module R₂ = LogRel K₂
open R₁.Properties L₁ using (conv)
open R₁ using (⊩ne; ⊩Level; ⊩Unit; ⊩ℕ; ⊩False; ⊩≡; ⊩U; ⊩∀; ⊩∃)
lift : ∀ {n} {A : Term n} → R₁.⊩ A → R₂.⊩ A
lift-∋ : ∀ {n} {A e : Term n} (p : R₁.⊩ A) → p R₁.∋ e → lift p R₂.∋ e
lower-∋ : ∀ {n} {A e : Term n} (p : R₁.⊩ A) → lift p R₂.∋ e → p R₁.∋ e
lift (⊩ne r s) = R₂.⊩ne r s
lift (⊩Level r) = R₂.⊩Level r
lift (⊩Unit r) = R₂.⊩Unit r
lift (⊩ℕ r) = R₂.⊩ℕ r
lift (⊩False r) = R₂.⊩False r
lift (⊩≡ r) = R₂.⊩≡ r
lift (⊩U r u) = R₂.⊩U r (emb u)
lift (⊩∀ r XB XB≈ ⊩B XC XC≈ ⊩C) =
R₂.⊩∀ r XB XB≈ (λ ρ → lift (⊩B ρ))
(λ ρ u∈ → XC ρ (lower-∋ (⊩B ρ) u∈))
(λ ρ u∈ → XC≈ ρ (lower-∋ (⊩B ρ) u∈))
(λ ρ u∈ → lift (⊩C ρ (lower-∋ (⊩B ρ) u∈)))
lift (⊩∃ r XB XB≈ ⊩B XC XC≈ ⊩C) =
R₂.⊩∃ r XB XB≈ (λ ρ → lift (⊩B ρ))
(λ ρ u∈ → XC ρ (lower-∋ (⊩B ρ) u∈))
(λ ρ u∈ → XC≈ ρ (lower-∋ (⊩B ρ) u∈))
(λ ρ u∈ → lift (⊩C ρ (lower-∋ (⊩B ρ) u∈)))
lift-∋ (⊩ne _ _) x = x
lift-∋ (⊩Level _) x = x
lift-∋ (⊩Unit _) x = x
lift-∋ (⊩ℕ _) x = x
lift-∋ (⊩False _) x = x
lift-∋ (⊩≡ _) x = x
lift-∋ (⊩U _ u) x = to u x
lift-∋ (⊩∀ _ _ _ ⊩B _ _ ⊩C) ⟨ s , app ⟩ =
⟨ s , (λ ρ u∈ → lift-∋ (⊩C ρ (lower-∋ (⊩B ρ) u∈)) (app ρ (lower-∋ (⊩B ρ) u∈))) ⟩
lift-∋ (⊩∃ _ _ _ ⊩B _ XC≈ ⊩C) ⟨ s , ⟨ q₁ , q₂ ⟩ ⟩ =
let q₁' = lift-∋ (⊩B idᵣ) q₁
q₁'' = lower-∋ (⊩B idᵣ) q₁'
in ⟨ s , ⟨ q₁' , lift-∋ (⊩C idᵣ q₁'')
(conv (⊩C idᵣ q₁) (⊩C idᵣ q₁'')
(≈-trans (XC≈ idᵣ q₁) (≈-sym (XC≈ idᵣ q₁''))) q₂) ⟩ ⟩
lower-∋ (⊩ne _ _) x = x
lower-∋ (⊩Level _) x = x
lower-∋ (⊩Unit _) x = x
lower-∋ (⊩ℕ _) x = x
lower-∋ (⊩False _) x = x
lower-∋ (⊩≡ _) x = x
lower-∋ (⊩U _ u) x = from u x
lower-∋ (⊩∀ _ _ _ ⊩B _ XC≈ ⊩C) ⟨ s , app' ⟩ =
⟨ s , (λ ρ u∈ →
let u∈' = lift-∋ (⊩B ρ) u∈
u∈'' = lower-∋ (⊩B ρ) u∈'
in conv (⊩C ρ u∈'') (⊩C ρ u∈) (≈-trans (XC≈ ρ u∈'') (≈-sym (XC≈ ρ u∈)))
(lower-∋ (⊩C ρ u∈'') (app' ρ u∈'))) ⟩
lower-∋ (⊩∃ _ _ _ ⊩B _ _ ⊩C) ⟨ s , ⟨ q₁' , q₂' ⟩ ⟩ =
⟨ s , ⟨ lower-∋ (⊩B idᵣ) q₁' , lower-∋ (⊩C idᵣ (lower-∋ (⊩B idᵣ) q₁')) q₂' ⟩ ⟩