open import 1Lab.HLevel.Retracts
open import 1Lab.Path.Groupoid
open import 1Lab.Univalence
open import 1Lab.HIT.S1
open import 1Lab.HLevel
open import 1Lab.Equiv
open import 1Lab.Path
open import 1Lab.Type

module 1Lab.Counterexamples.IsIso where

is-iso is not a propositionπŸ”—

We show that if is-iso were a proposition, then (x : A) β†’ x ≑ x would be contractible for any choice of A. Taking A to be SΒΉ, we show that this can not be the case. Suppose that is-iso is a proposition.

  _ (iso-is-prop : βˆ€ {β„“} {A B : Type β„“} {f : A β†’ B} β†’ is-prop (is-iso f))

First we characterise the type is-iso f by showing that, if it is inhabited, then it is equivalent to the centre of A, i.e.Β the loop-assigning maps of A:

  lemma : βˆ€ {β„“} {A B : Type β„“} {f : A β†’ B} β†’ is-iso f β†’ is-iso f ≃ ((x : A) β†’ x ≑ x)
  lemma {A = A} {B} {f} iiso =
    EquivJ (Ξ» _ f β†’ is-iso (f .fst) ≃ ((x : A) β†’ x ≑ x))
           (Iso→Equiv helper)
           (f , is-iso→is-equiv iiso)

By equivalence induction, it suffices to cover the case where f is the identity function. In that case, we can construct an isomorphism quite readily, where the proof uses our assumption iso-is-prop for convenience.

      helper : Iso _ _
      helper .fst iiso x =
        sym (iiso .is-iso.linv x) βˆ™ iiso .is-iso.rinv x
      helper .snd .is-iso.inv x = iso (Ξ» x β†’ x) x (Ξ» _ β†’ refl)
      helper .snd .is-iso.rinv p = funext Ξ» x β†’ βˆ™-id-l _
      helper .snd .is-iso.linv x = iso-is-prop _ _

We thus have that is-iso id ≃ ((x : A) β†’ x ≑ x) - since the former is a prop (by assumption), then so is the latter:

  is-prop-loops : βˆ€ {β„“} {A : Type β„“} β†’ is-prop ((x : A) β†’ x ≑ x)
  is-prop-loops {A = A} = equiv→is-hlevel 1 (helper .fst) (helper .snd) iso-is-prop
    where helper = lemma {f = Ξ» (x : A) β†’ x}
                     (iso (Ξ» x β†’ x) (Ξ» x β†’ refl) (Ξ» x β†’ refl))

Thus, it suffices to choose a type for which (x : A) β†’ x ≑ x has two distinct elements. We go with the circle, SΒΉ:

  Β¬is-prop-loops : is-prop ((x : SΒΉ) β†’ x ≑ x) β†’ βŠ₯
  ¬is-prop-loops prop = refl≠loop (happly (prop (λ x → refl) always-loop) base)

Hence, a contradiction:

  contra : βŠ₯
  contra = Β¬is-prop-loops is-prop-loops