\begin{code}
{-# OPTIONS --without-K #-}
module hprop-truncation where
open import tiny-library
\end{code}
\begin{code}
private
data ∥_∥' (X : Set) : Set where
∣_∣' : X → ∥ X ∥'
∥_∥ : Set → Set
∥_∥ = ∥_∥'
postulate truncation-path : {X : Set} → hprop ∥ X ∥
∣_∣ : {X : Set} → X → ∥ X ∥
∣_∣ = ∣_∣'
truncation-ind : {X : Set} {P : ∥ X ∥ → Set} → ((s : ∥ X ∥) → hprop(P s)) → ((x : X) → P ∣ x ∣)
→ (s : ∥ X ∥) → P s
truncation-ind _ f ∣ x ∣' = f x
truncation-rec : {X P : Set} → hprop P → (X → P) → ∥ X ∥ → P
truncation-rec _ f ∣ x ∣' = f x
\end{code}