---
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