Martin Escardo

\begin{code}

{-# OPTIONS --safe --without-K #-}

module UF.Universes where

open import MLTT.Plus-Properties
open import MLTT.Spartan hiding (๐Ÿš)
open import UF.Equiv
open import UF.Sets
open import UF.Univalence

universes-are-not-sets : is-univalent ๐“ค โ†’ ยฌ (is-set (๐“ค ฬ‡ ))
universes-are-not-sets {๐“ค} ua = ฮณ
 where
  ๐Ÿš : ๐“ค ฬ‡
  ๐Ÿš = ๐Ÿ™ {๐“ค} + ๐Ÿ™ {๐“ค}

  swap : ๐Ÿš โ†’ ๐Ÿš
  swap (inl โ‹†) = inr โ‹†
  swap (inr โ‹†) = inl โ‹†

  swap-involutive : (b : ๐Ÿš) โ†’ swap (swap b) ๏ผ b
  swap-involutive (inl โ‹†) = refl
  swap-involutive (inr โ‹†) = refl

  eโ‚€ eโ‚ : ๐Ÿš โ‰ƒ ๐Ÿš
  eโ‚€ = โ‰ƒ-refl ๐Ÿš
  eโ‚ = qinveq swap (swap , swap-involutive , swap-involutive)

  eโ‚€-is-not-eโ‚ : eโ‚€ โ‰  eโ‚
  eโ‚€-is-not-eโ‚ p = +disjoint r
   where
    q : id ๏ผ swap
    q = ap โŒœ_โŒ p

    r : inl โ‹† ๏ผ inr โ‹†
    r = ap (ฮป - โ†’ - (inl โ‹†)) q

  pโ‚€ pโ‚ : ๐Ÿš ๏ผ ๐Ÿš
  pโ‚€ = eqtoid ua ๐Ÿš ๐Ÿš eโ‚€
  pโ‚ = eqtoid ua ๐Ÿš ๐Ÿš eโ‚

  pโ‚€-is-not-pโ‚ : pโ‚€ โ‰  pโ‚
  pโ‚€-is-not-pโ‚ q = eโ‚€-is-not-eโ‚ r
   where
    r = eโ‚€            ๏ผโŸจ (inverses-are-sections (idtoeq ๐Ÿš ๐Ÿš) (ua ๐Ÿš ๐Ÿš) eโ‚€)โปยน โŸฉ
        idtoeq ๐Ÿš ๐Ÿš pโ‚€ ๏ผโŸจ ap (idtoeq ๐Ÿš ๐Ÿš) q                                  โŸฉ
        idtoeq ๐Ÿš ๐Ÿš pโ‚ ๏ผโŸจ inverses-are-sections (idtoeq ๐Ÿš ๐Ÿš) (ua ๐Ÿš ๐Ÿš) eโ‚     โŸฉ
        eโ‚            โˆŽ

  ฮณ : ยฌ (is-set (๐“ค ฬ‡ ))
  ฮณ s = pโ‚€-is-not-pโ‚ q
   where
    q : pโ‚€ ๏ผ pโ‚
    q = s pโ‚€ pโ‚

\end{code}