---
title: Definition of Formal Topology
author: Ayberk Tosun
date-started: 2026-07-06
date-completed: 2026-09-01
---

This module defines the notions of formal topology and quasi formal topology,
following [1] as a reference.

\begin{code}

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

open import UF.FunExt
open import UF.PropTrunc

module Locales.FormalTopology.Definition
        (pt : propositional-truncations-exist)
        (fe : Fun-Ext)
       where

open import Locales.Frame pt fe hiding (โŸจ_โŸฉ)
open import MLTT.Spartan
open import Notation.UnderlyingType
open import UF.Logic
open import UF.Powerset
open import UF.Sets
open import UF.SubtypeClassifier

open AllCombinators pt fe
open PropositionalSubsetInclusionNotation fe

\end{code}

\section{Quasi formal topology}

We define the notion of quasi formal topology as in Definition 2.1 of [1].

The rule that Negri calls _reflexivity_:

\begin{code}

satisfies-cover-reflexivity : {A : ๐“ค ฬ‡ } โ†’ (A โ†’ ๐“Ÿ A โ†’ ฮฉ ๐“ค) โ†’ ฮฉ (๐“ค โบ)
satisfies-cover-reflexivity {_} {A} _โ—_ = โฑฏ a ๊ž‰ A , โฑฏ U ๊ž‰ ๐“Ÿ A , a โˆˆโ‚š U โ‡’ a โ— U

\end{code}

The rule that Negri calls _transitivity_:

\begin{code}

satisfies-cover-transitivity : {A : ๐“ค ฬ‡ } โ†’ (A โ†’ ๐“Ÿ A โ†’ ฮฉ ๐“ค) โ†’ ฮฉ (๐“ค โบ)
satisfies-cover-transitivity {_} {A} _โ—_ =
 โฑฏ a ๊ž‰ A , โฑฏ U V ๊ž‰ ๐“Ÿ A , a โ— U โ‡’ U โІโ‚š (_โ— V) โ‡’ a โ— V

\end{code}

We are now ready to define the notion of _quasi formal topology_, exactly as
defined in Definition 2.1 of [1].

\begin{code}

Quasi-Formal-Topology-Structure : ๐“ค ฬ‡ โ†’ ๐“ค โบ ฬ‡
Quasi-Formal-Topology-Structure {๐“ค} A =
 ฮฃ _โ—_ ๊ž‰ (A โ†’ ๐“Ÿ A โ†’ ฮฉ ๐“ค) ,
    is-set A
  ร— (satisfies-cover-reflexivity _โ—_ holds)
  ร— (satisfies-cover-transitivity _โ—_ holds)

Quasi-Formal-Topology : (๐“ค : Universe) โ†’ ๐“ค โบ ฬ‡
Quasi-Formal-Topology ๐“ค = ฮฃ A ๊ž‰ ๐“ค ฬ‡ , Quasi-Formal-Topology-Structure A

\end{code}

\subsection{Named projections for quasi formal topologies}

Named projections for the `Quasi-Formal-Topology` type.

\begin{code}

carrier-of-quasi-formal-topology : Quasi-Formal-Topology ๐“ค โ†’ ๐“ค ฬ‡
carrier-of-quasi-formal-topology (A , _) = A

instance
 Underlying-Type-Quasi-Formal-Topology
  : Underlying-Type (Quasi-Formal-Topology ๐“ค) (๐“ค ฬ‡)
 Underlying-Type-Quasi-Formal-Topology =
  record { โŸจ_โŸฉ = carrier-of-quasi-formal-topology }

carrier-of-quasi-formal-topology-is-set
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ is-set โŸจ ๐’œ โŸฉ
carrier-of-quasi-formal-topology-is-set {๐“ค} (_ , _ , ฯƒ , _) = ฯƒ

cover-of-quasi-formal-topology
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ โŸจ ๐’œ โŸฉ
 โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ
 โ†’ ฮฉ ๐“ค
cover-of-quasi-formal-topology (_ , _โ—_ , _) = _โ—_

infix 5 cover-of-quasi-formal-topology
syntax cover-of-quasi-formal-topology ๐’œ a U = a โ—Q[ ๐’œ ] U

reflexivity-of-quasi-cover
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ satisfies-cover-reflexivity (ฮป a U โ†’ a โ—Q[ ๐’œ ] U) holds
reflexivity-of-quasi-cover (_ , _ , _ , ฮฒ , _) = ฮฒ

transitivity-of-quasi-cover
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ satisfies-cover-transitivity (ฮป a U โ†’ a โ—Q[ ๐’œ ] U) holds
transitivity-of-quasi-cover (_ , _ , _ , _ , ฮณ) = ฮณ

\end{code}

\subsection{Basic properties of quasi formal topologies}

We previously used the relation `U โІ (_โ— V)`. We now define the syntax
`U โ—Qโบ[ ๐’œ ] V` as an abbreviation for this.

\begin{code}

cover-plus-of-quasi-formal-topology
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ
 โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ
 โ†’ ฮฉ ๐“ค
cover-plus-of-quasi-formal-topology ๐’œ U V = U โІโ‚š (ฮป - โ†’ - โ—Q[ ๐’œ ] V)

infix 5 cover-plus-of-quasi-formal-topology
syntax cover-plus-of-quasi-formal-topology ๐’œ U V = U โ—Qโบ[ ๐’œ ] V

transitivity-of-quasi-cover-plus
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ (โฑฏ U V W ๊ž‰ ๐“Ÿ โŸจ ๐’œ โŸฉ , U โ—Qโบ[ ๐’œ ] V โ‡’ V โ—Qโบ[ ๐’œ ] W โ‡’ U โ—Qโบ[ ๐’œ ] W) holds
transitivity-of-quasi-cover-plus ๐’œ U V W p q a h =
 transitivity-of-quasi-cover ๐’œ a V W โ€  q
  where
   โ€  : (a โ—Q[ ๐’œ ] V) holds
   โ€  = p a h

\end{code}

The `_โ—โบ_` relation is reflexive.

\begin{code}

reflexivity-of-quasi-cover-plus
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ (โฑฏ U ๊ž‰ ๐“Ÿ โŸจ ๐’œ โŸฉ , U โ—Qโบ[ ๐’œ ] U) holds
reflexivity-of-quasi-cover-plus ๐’œ U a = reflexivity-of-quasi-cover ๐’œ a U

\end{code}

Two subsets of a quasi formal topology are called _cover equivalent_ if they
cover each other. We define the syntax `U ๏ผ[ ๐’œ ]๏ผ V` to denote this.

\begin{code}

cover-equivalence-of-quasi-formal-topology
 : (๐’œ : Quasi-Formal-Topology ๐“ค)
 โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ
 โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ
 โ†’ ฮฉ ๐“ค
cover-equivalence-of-quasi-formal-topology ๐’œ U V =
 (U โ—Qโบ[ ๐’œ ] V) โˆง (V โ—Qโบ[ ๐’œ ] U)

infix 5 cover-equivalence-of-quasi-formal-topology
syntax cover-equivalence-of-quasi-formal-topology ๐’œ U V = U =[ ๐’œ ]= V

\end{code}

\subsection{Cover reasoning for quasi formal topologies}

The `Quasi-Cover-Reasoning` module defines constructs for writing chains of
cover transitivity in a pretty way.

\begin{code}

module Quasi-Cover-Reasoning (๐’œ : Quasi-Formal-Topology ๐“ค) where

 _โ—โŸจ_โŸฉ_ : (a : โŸจ ๐’œ โŸฉ) {U V : ๐“Ÿ โŸจ ๐’œ โŸฉ}
        โ†’ (a โ—Q[ ๐’œ ] U) holds
        โ†’ (U โ—Qโบ[ ๐’œ ] V) holds
        โ†’ (a โ—Q[ ๐’œ ] V) holds
 a โ—โŸจ p โŸฉ q = transitivity-of-quasi-cover ๐’œ a _ _ p q

 _โ—โบโŸจ_โŸฉ_ : (U : ๐“Ÿ โŸจ ๐’œ โŸฉ) {V W : ๐“Ÿ โŸจ ๐’œ โŸฉ}
        โ†’ (U โ—Qโบ[ ๐’œ ] V) holds
        โ†’ (V โ—Qโบ[ ๐’œ ] W) holds
        โ†’ (U โ—Qโบ[ ๐’œ ] W) holds
 U โ—โบโŸจ p โŸฉ q = transitivity-of-quasi-cover-plus ๐’œ U _ _ p q

 _๏ผโŸจ_โŸฉc_ : (U : ๐“Ÿ โŸจ ๐’œ โŸฉ) {V W : ๐“Ÿ โŸจ ๐’œ โŸฉ}
          โ†’ U ๏ผ V โ†’ (V โ—Qโบ[ ๐’œ ] W) holds โ†’ (U โ—Qโบ[ ๐’œ ] W) holds
 _ ๏ผโŸจ p โŸฉc q = transport (ฮป - โ†’ (- โ—Qโบ[ ๐’œ ] _) holds) (p โปยน) q

 _โ–  : (U : ๐“Ÿ โŸจ ๐’œ โŸฉ) โ†’ (U โ—Qโบ[ ๐’œ ] U) holds
 _โ–  = reflexivity-of-quasi-cover-plus ๐’œ

 infixr 0 _โ—โŸจ_โŸฉ_
 infixr 0 _โ—โบโŸจ_โŸฉ_
 infixr 0 _๏ผโŸจ_โŸฉc_
 infix  1 _โ– 

\end{code}

\section{Formal topology}

A formal topology is a quasi formal topology equipped with a partial order,
satisfying the additional axioms of _left_ and _right_. These are the last two
rules given in Definition 2.1 of [1].

We first define the condition that Negri [1] calls _left_:

\begin{code}

satisfies-cover-left-rule : {A : ๐“ค ฬ‡} โ†’ (A โ†’ A โ†’ ฮฉ ๐“ค) โ†’ (A โ†’ ๐“Ÿ A โ†’ ฮฉ ๐“ค) โ†’ ฮฉ (๐“ค โบ)
satisfies-cover-left-rule {_} {A} _โŠ‘_ _โ—_ =
 โฑฏ a b ๊ž‰ A , โฑฏ U ๊ž‰ ๐“Ÿ A , b โŠ‘ a โ‡’ a โ— U โ‡’ b โ— U

\end{code}

Some notation for downward closures of sets as well as the intersection of
downward closures.

\begin{code}

module Downward-Closure-Intersection-Syntax {A : ๐“ค ฬ‡} (_โŠ‘_ : A โ†’ A โ†’ ฮฉ ๐“ค) where

 โ†“_ : ๐“Ÿ A โ†’ ๐“Ÿ A
 โ†“ U = ฮป a โ†’ ฦŽโ‚š u ๊ž‰ A , (u โˆˆโ‚š U โˆง a โŠ‘ u)

 _โŠ“_ : ๐“Ÿ A โ†’ ๐“Ÿ A โ†’ ๐“Ÿ A
 U โŠ“ V = (โ†“ U) โˆฉ (โ†“ V)

 infix 6 _โŠ“_
 infix 7 โ†“_

\end{code}

Now, we define the condition that Negri calls _right_:

\begin{code}

satisfies-cover-right-rule : {A : ๐“ค ฬ‡}
                           โ†’ (A โ†’ A โ†’ ฮฉ ๐“ค)
                           โ†’ (A โ†’ ๐“Ÿ A โ†’ ฮฉ ๐“ค)
                           โ†’ ฮฉ (๐“ค โบ)
satisfies-cover-right-rule {_} {A} _โŠ‘_ _โ—_ =
 โฑฏ a ๊ž‰ A , โฑฏ U V ๊ž‰ ๐“Ÿ A , a โ— U โ‡’ a โ— V โ‡’ a โ— (U โŠ“ V)
  where
   open Downward-Closure-Intersection-Syntax _โŠ‘_ using (_โŠ“_)

\end{code}

We are now ready to define the notion of formal topology. Unlike Negri, we also
require the order in consideration to be antisymmetric.

\begin{code}

Formal-Topology-Structure : ๐“ค ฬ‡ โ†’ ๐“ค โบ ฬ‡
Formal-Topology-Structure {๐“ค} A =
 ฮฃ _โŠ‘_ ๊ž‰ (A โ†’ A โ†’ ฮฉ ๐“ค) ,
  ฮฃ _โ—_ ๊ž‰ (A โ†’ ๐“Ÿ A โ†’ ฮฉ ๐“ค) ,
     (is-reflexive _โŠ‘_ holds)
   ร— (is-transitive _โŠ‘_ holds)
   ร— (is-antisymmetric _โŠ‘_)
   ร— (satisfies-cover-reflexivity _โ—_ holds)
   ร— (satisfies-cover-transitivity _โ—_ holds)
   ร— (satisfies-cover-left-rule _โŠ‘_ _โ—_ holds)
   ร— (satisfies-cover-right-rule _โŠ‘_ _โ—_ holds)

Formal-Topology : (๐“ค : Universe) โ†’ ๐“ค โบ ฬ‡
Formal-Topology ๐“ค = ฮฃ A ๊ž‰ ๐“ค ฬ‡ , Formal-Topology-Structure A

\end{code}

\subsection{Named projections for formal topologies}

We now define some named projections for the `Formal-Topology` type.

\begin{code}

carrier-of-formal-topology : Formal-Topology ๐“ค โ†’ ๐“ค ฬ‡
carrier-of-formal-topology (A , _) = A

instance
 Underlying-Type-Formal-Topology : Underlying-Type (Formal-Topology ๐“ค) (๐“ค ฬ‡)
 Underlying-Type-Formal-Topology = record { โŸจ_โŸฉ = carrier-of-formal-topology }

order-of-formal-topology : (๐’œ : Formal-Topology ๐“ค) โ†’ โŸจ ๐’œ โŸฉ โ†’ โŸจ ๐’œ โŸฉ โ†’ ฮฉ ๐“ค
order-of-formal-topology (_ , _โŠ‘_ , _) = _โŠ‘_

infix 5 order-of-formal-topology
syntax order-of-formal-topology ๐’œ a b = a โŠ‘[ ๐’œ ] b

cover-of-formal-topology : (๐’œ : Formal-Topology ๐“ค) โ†’ โŸจ ๐’œ โŸฉ โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ โ†’ ฮฉ ๐“ค
cover-of-formal-topology (_ , _ , _โ—_ , _) = _โ—_

infix 5 cover-of-formal-topology
syntax cover-of-formal-topology ๐’œ a U = a โ—[ ๐’œ ] U

reflexivity-of-order
 : (๐’œ : Formal-Topology ๐“ค)
 โ†’ is-reflexive (order-of-formal-topology ๐’œ) holds
reflexivity-of-order (_ , _ , _ , ฮฒ , _) = ฮฒ

transitivity-of-order
 : (๐’œ : Formal-Topology ๐“ค)
 โ†’ is-transitive (order-of-formal-topology ๐’œ) holds
transitivity-of-order (_ , _ , _ , _ , ฮณ , _) = ฮณ

antisymmetry-of-order
 : (๐’œ : Formal-Topology ๐“ค)
 โ†’ is-antisymmetric (order-of-formal-topology ๐’œ)
antisymmetry-of-order (_ , _ , _ , _ , _ , ฮด , _) = ฮด

cover-satisfies-left-rule
 : (๐’œ : Formal-Topology ๐“ค)
 โ†’ satisfies-cover-left-rule
    (order-of-formal-topology ๐’œ)
    (cover-of-formal-topology ๐’œ)
     holds
cover-satisfies-left-rule (_ , _ , _ , _ , _ , _ , _ , _ , ฮท , _) = ฮท

cover-satisfies-right-rule
 : (๐’œ : Formal-Topology ๐“ค)
 โ†’ satisfies-cover-right-rule
    (order-of-formal-topology ๐’œ)
    (cover-of-formal-topology ๐’œ)
     holds
cover-satisfies-right-rule (_ , _ , _ , _ , _ , _ , _ , _ , _ , ฮธ) = ฮธ

\end{code}

The sethood of the carrier of a formal topology follows from the fact it is
equipped with a partial order.

\begin{code}

carrier-of-formal-topology-is-set : (๐’œ : Formal-Topology ๐“ค) โ†’ is-set โŸจ ๐’œ โŸฉ
carrier-of-formal-topology-is-set {๐“ค} (A , _โŠ‘_ , _ , ฮฒ , ฮณ , ฮด , _) =
 carrier-of-[ P ]-is-set
  where
   P : Poset ๐“ค ๐“ค
   P = A , _โŠ‘_ , (ฮฒ , ฮณ) , ฮด

\end{code}

The underlying poset of a formal topology.

\begin{code}

underlying-poset-of-formal-topology : (๐’œ : Formal-Topology ๐“ค) โ†’ Poset ๐“ค ๐“ค
underlying-poset-of-formal-topology {๐“ค} (A , _โŠ‘_ , _ , ฮฒ , ฮณ , ฮด , _) =
 A , _โŠ‘_ , (ฮฒ , ฮณ) , ฮด

\end{code}

The underlying quasi formal topology of a formal topology.

\begin{code}

underlying-quasi-formal-topology : Formal-Topology ๐“ค โ†’ Quasi-Formal-Topology ๐“ค
underlying-quasi-formal-topology ๐’œ@(A , _ , _โ—_ , _ , _ , _ , ฯ , ฯ„ , _ , _) =
 A , _โ—_ , carrier-of-formal-topology-is-set ๐’œ , ฯ , ฯ„

\end{code}

The `_โ—โบ_` operation for formal topologies.

\begin{code}

cover-plus-of-formal-topology : (๐’œ : Formal-Topology ๐“ค) โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ โ†’ ๐“Ÿ โŸจ ๐’œ โŸฉ โ†’ ฮฉ ๐“ค
cover-plus-of-formal-topology =
 cover-plus-of-quasi-formal-topology โˆ˜ underlying-quasi-formal-topology

infix 5 cover-plus-of-formal-topology
syntax cover-plus-of-formal-topology ๐’œ U V = U โ—โบ[ ๐’œ ] V

transitivity-of-cover-plus
 : (๐’œ : Formal-Topology ๐“ค)
 โ†’ (โฑฏ U V W ๊ž‰ ๐“Ÿ โŸจ ๐’œ โŸฉ , U โ—โบ[ ๐’œ ] V โ‡’ V โ—โบ[ ๐’œ ] W โ‡’ U โ—โบ[ ๐’œ ] W) holds
transitivity-of-cover-plus =
 transitivity-of-quasi-cover-plus โˆ˜ underlying-quasi-formal-topology

\end{code}

\section{Bibliography}

[1]: Sara Negri. _Continuous domains as formal spaces_. Mathematical Structures
     in Computer Science, Volume 12, No. 1, pp. 19โ€“52, 2002.
     DOI:10.1017/S0960129501003450