Ensured OTT Consistency

I play with observational type theory.

Here the equality π-types ( πis lowercase Π, i.e. π A Bis the code for (x : A) -> B x), defined mutually with coercion:

π A₁ B₁ ≃ π A₂ B₂ = σ (A₂ ≃ A₁) λ P -> π _ λ x -> B₁ (coerce P x) ≃ B₂ x

and the equality of functions defined accordingly ( σ- lower case Σ):

_≅_ {A = π A₁ B₁} {π A₂ B₂} f₁ f₂ = σ (A₂ ≃ A₁) λ P -> π _ λ x -> f₁ (coerce P x) ≅ f₂ x

So, instead of “equal functions mapping equal inputs to equal outputs”, we have “equal functions defining equal inputs by definition by equal outputs”.

In this setting coherence

coerce : ∀ {α β} {A : Univ α} {B : Univ β} -> ⟦ A ≃ B ⟧ᵀ -> ⟦ A ⟧ᵀ -> ⟦ B ⟧ᵀ
coherence : ∀ {α β} {A : Univ α} {B : Univ β}
          -> (P : ⟦ A ≃ B ⟧ᵀ) -> (x : ⟦ A ⟧ᵀ) -> ⟦ x ≅ coerce P x ⟧ᵀ

( Univ 0is Prop, Univ (suc α)is Type α)

provable. The only thing I needed to postulate was

postulate ≃-refl : ∀ {α} -> (A : Univ α) -> ⟦ A ≃ A ⟧ᵀ

, A ≃ A ( , trustMe _≟_ : ∀ {α} {A : Set α} (x y : A) -> Maybe (x ≡ y)).

-, subst .

- ? - ? . , ? - , coherence, , ?

( , ).

+4
1

-, . -, , , , , , , . -, ( , ), , . OTT, Agda 1, . , Agda 2.

- ,

-, subst .

P : X -> Set, a, b : X q : a = b, P a -> P b. " " , refl P : P = P, q P a = P b. " ", q a b.

refl subst " " , " ". , , , subst. , coerce ( , ), .

. , , (, , ). , , .

, - , , , . , " ", " ".

+5

Source: https://habr.com/ru/post/1617848/


All Articles