--------------------------------------------------------------------------------
title:          Properties of locale homeomorphisms
author:         Ayberk Tosun
date-started:   2024-04-18
--------------------------------------------------------------------------------

Some properties of locale homeomorphisms.

\begin{code}[hide]

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

open import MLTT.Spartan hiding (𝟚; β‚€; ₁)
open import UF.FunExt
open import UF.PropTrunc
open import UF.Size
open import UF.Subsingletons
open import UF.UA-FunExt
open import UF.Univalence

module Locales.ContinuousMap.Homeomorphism-Properties
        (ua : Univalence)
        (pt : propositional-truncations-exist)
        (sr : Set-Replacement pt)
       where

private
 fe : Fun-Ext
 fe {𝓀} {π“₯} = univalence-gives-funext' 𝓀 π“₯ (ua 𝓀) (ua (𝓀 βŠ” π“₯))

 pe : Prop-Ext
 pe {𝓀} = univalence-gives-propext (ua 𝓀)

open import Locales.ContinuousMap.FrameIsomorphism-Definition pt fe
open import Locales.ContinuousMap.Homeomorphism-Definition pt fe
open import Locales.Frame pt fe
open import Locales.SIP.FrameSIP ua pt sr
open import UF.Logic
open import UF.SubtypeClassifier

open AllCombinators pt fe
open Locale

\end{code}

Homeomorphic locales are equal.

\begin{code}

homeomorphic-locales-are-equal : (X Y : Locale (𝓀 ⁺) 𝓀 𝓀) β†’ X β‰…cβ‰… Y β†’ X = Y
homeomorphic-locales-are-equal X Y 𝒽 = to-locale-= Y X † ⁻¹
 where
  open FrameIsomorphisms

  r : π’ͺ Y β‰…fβ‰… π’ͺ X
  r = isomorphism-to-isomorphismα΅£
       (π’ͺ Y)
       (π’ͺ X)
       (isomorphismα΅£-to-isomorphism (π’ͺ Y) (π’ͺ X) 𝒽)

  † : π’ͺ Y = π’ͺ X
  † = isomorphic-frames-are-equal (π’ͺ Y) (π’ͺ X) r

\end{code}

Transport lemma for homeomorphic locales.

\begin{code}

β‰…cβ‰…-transport : (X Y : Locale (𝓀 ⁺) 𝓀 𝓀)
              β†’ (P : Locale (𝓀 ⁺) 𝓀 𝓀 β†’ Ξ© 𝓣) β†’ X β‰…cβ‰… Y β†’ P X holds β†’ P Y holds
β‰…cβ‰…-transport X Y P 𝒽 = transport (_holds ∘ P) p
 where
  p : X = Y
  p = homeomorphic-locales-are-equal X Y 𝒽

\end{code}

Added on 2024-05-07.

Being homeomorphic is a symmetric relation.

\begin{code}

β‰…c-sym : (X Y : Locale (𝓀 ⁺) 𝓀 𝓀) β†’ X β‰…cβ‰… Y β†’ Y β‰…cβ‰… X
β‰…c-sym X Y 𝒽 =
 record { π“ˆ = 𝓇 ; 𝓇 = π“ˆ ; 𝓇-cancels-π“ˆ = π“ˆ-cancels-𝓇 ; π“ˆ-cancels-𝓇 = 𝓇-cancels-π“ˆ}
  where
   open FrameIsomorphisms.Isomorphismα΅£ 𝒽

\end{code}