General topology in Coq [maintainers=@amiloradovsky,@Columbus240,@stop-cran]
Rocq Prover
52
397 commits
updated May 23, 2026
This library develops some of the basic concepts and results of general topology in Coq.
TopologyThe easiest way to install the latest released version of Topology is via OPAM:
opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-topology
To instead build both Topology and Zorn's Lemma manually, do:
git clone https://github.com/coq-community/topology.git
cd topology
make # or make -j <number-of-cores-on-your-machine>
A ready-to-use development environment lives in .devcontainer/,
based on ocaml/opam:debian-12-ocaml-4.14 (multi-arch: amd64 + arm64).
The image pins Rocq 9.1 via opam and preinstalls dune, coq-lsp, and
vsrocq-language-server so the VsRocq
or coq-lsp VS Code clients work
out of the box.
Open the repository in VS Code and run Dev Containers: Reopen in
Container. The first build takes ~15-30 minutes (Rocq is compiled from
source via opam); subsequent rebuilds reuse the Docker layer cache. Once
inside, run make -j$(nproc) from the integrated terminal.
TopologicalSpaces.vInteriorsClosures.vNeighborhoods.vOpenBases.vNeighborhoodBases.vSubbases.vContinuity.vHomeomorphisms.vFilterLimits.vNets.vFiltersAndNets.v - various transformations between filters and netsCompactness.vConnectedness.vCountabilityAxioms.v - first countable, second countable, separable, LindelofSeparatednessAxioms.v - T0, T1, Hausdorff, etc.OrderTopology.vStrongTopology.v - strong topology induced by a family of maps from
topological spacesWeakTopology.v - weak topology induced by a family of maps to
topological spacesProductTopology.vSumTopology.v - also called "disjoint union" or "coproduct"SubspaceTopology.vQuotientTopology.vAdjunctionSpace.v - quotient that glues a subspace to a pointContinuousFactorization.v - a continuous map factors through its imageMetricSpaces.vLipschitzMaps.v - Lipschitz-continuous maps between metric spacesCompleteness.vCompletion.vUniformTopology.v - the topology of uniform convergenceBanachFixedPoint.v - the Banach fixed-point theorem for contractions
on complete metric spacesSupInf.vRationalsInReals.vRTopology.v - definition and properties of topology on RRFuncContinuity.v - reproof of continuity of basic functions on RUrysohnsLemma.vTietzeExtension.vExamples/S1.v - the unit circle as a quotient of [-1, 1]In alphabetical order, except where related files are grouped together:
Cardinals.v - collects the files in the folder Cardinals
Cardinals/Cardinals.v defines cardinal comparisons for types
Cardinals/CardinalsEns.v defines cardinal comparisons for ensembles
Cardinals/Combinatorics.v defines some elementary bijections
Cardinals/Comparability.v given choice, cardinals form a total order
Cardinals/CSB.v prove Cantor-Schröder-Bernstein theorem
Cardinals/Diagonalization.v Cantor's diagonalization and corollaries
Cardinals/LeastCardinalsEns.v the cardinal orders are well-founded
Classical_Wf.v - proofs of the classical equivalence of wellfoundedness, the minimal element property, and the descending sequence property
CSB.v - the Cantor-Schroeder-Bernstein theorem
DecidableDec.v - classic_dec: forall P: Prop, {P} + {~P}.
DependentTypeChoice.v - choice on a relation (forall a: A, B a -> Prop)
DirectedSets.v - basics of directed sets
Filters.v - basics of filters
EnsembleProduct.v - products of ensembles, living in the type A * B
EnsemblesImplicit.v - settings for appropriate implicit parameters for the standard library's Ensembles functions
FiniteImplicit.v - same for the standard library's Sets/Finite_sets
ImageImplicit.v - same for the standard library's Sets/Image
Relation_Definitions_Implicit.v - same for the standard library's Relation_Definitions
EnsemblesExplicit.v - clears the implicit parameters set in the above files
EnsemblesSpec.v - defines a notation for e.g. [ n: nat | n > 5 /\ even n ] : Ensemble nat.
EnsemblesTactics.v - defines tactics that help in proofs about Ensembles
EnsemblesUtf8.v - optional UTF-8 notations for set operations
Families.v - operations on families of subsets of X, i.e. Ensemble (Ensemble X)
IndexedFamilies.v - same for indexed families A -> Ensemble X
FiniteIntersections.v - defines the finite intersections of a family of subsets
FiniteTypes.v - definitions and results about finite types
CountableTypes.v - same for countable types
InfiniteTypes.v - same for infinite types
FunctionProperties.v - injective, surjective, etc.
FunctionProperitesEns.v - same but definitions restricted to ensembles
Image.v - images of subsets under functions
InverseImage.v - inverse images of subsets under functions
Ordinals.v - a construction of the ordinals without reference to well-orders
Powerset_facts.v - some lemmas about the operations on subsets that the stdlib is missing
Proj1SigInjective.v - inclusion of { x: X | P x } into X is injective
Quotients.v - quotients by equivalence relations, and induced functions on them
ReverseMath - a folder with some results in constructive reverse mathematics
WellOrders.v - some basic properties of well-orders, including a proof that Zorn's Lemma implies the well-ordering principle
ZornsLemma.v - proof that choice implies Zorn's Lemma
Rocq Prover
99.8%
General topology in Coq [maintainers=@amiloradovsky,@Columbus240,@stop-cran]
Rocq Prover
52
397 commits
updated May 23, 2026
This library develops some of the basic concepts and results of general topology in Coq.
TopologyThe easiest way to install the latest released version of Topology is via OPAM:
opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-topology
To instead build both Topology and Zorn's Lemma manually, do:
git clone https://github.com/coq-community/topology.git
cd topology
make # or make -j <number-of-cores-on-your-machine>
A ready-to-use development environment lives in .devcontainer/,
based on ocaml/opam:debian-12-ocaml-4.14 (multi-arch: amd64 + arm64).
The image pins Rocq 9.1 via opam and preinstalls dune, coq-lsp, and
vsrocq-language-server so the VsRocq
or coq-lsp VS Code clients work
out of the box.
Open the repository in VS Code and run Dev Containers: Reopen in
Container. The first build takes ~15-30 minutes (Rocq is compiled from
source via opam); subsequent rebuilds reuse the Docker layer cache. Once
inside, run make -j$(nproc) from the integrated terminal.
TopologicalSpaces.vInteriorsClosures.vNeighborhoods.vOpenBases.vNeighborhoodBases.vSubbases.vContinuity.vHomeomorphisms.vFilterLimits.vNets.vFiltersAndNets.v - various transformations between filters and netsCompactness.vConnectedness.vCountabilityAxioms.v - first countable, second countable, separable, LindelofSeparatednessAxioms.v - T0, T1, Hausdorff, etc.OrderTopology.vStrongTopology.v - strong topology induced by a family of maps from
topological spacesWeakTopology.v - weak topology induced by a family of maps to
topological spacesProductTopology.vSumTopology.v - also called "disjoint union" or "coproduct"SubspaceTopology.vQuotientTopology.vAdjunctionSpace.v - quotient that glues a subspace to a pointContinuousFactorization.v - a continuous map factors through its imageMetricSpaces.vLipschitzMaps.v - Lipschitz-continuous maps between metric spacesCompleteness.vCompletion.vUniformTopology.v - the topology of uniform convergenceBanachFixedPoint.v - the Banach fixed-point theorem for contractions
on complete metric spacesSupInf.vRationalsInReals.vRTopology.v - definition and properties of topology on RRFuncContinuity.v - reproof of continuity of basic functions on RUrysohnsLemma.vTietzeExtension.vExamples/S1.v - the unit circle as a quotient of [-1, 1]In alphabetical order, except where related files are grouped together:
Cardinals.v - collects the files in the folder Cardinals
Cardinals/Cardinals.v defines cardinal comparisons for types
Cardinals/CardinalsEns.v defines cardinal comparisons for ensembles
Cardinals/Combinatorics.v defines some elementary bijections
Cardinals/Comparability.v given choice, cardinals form a total order
Cardinals/CSB.v prove Cantor-Schröder-Bernstein theorem
Cardinals/Diagonalization.v Cantor's diagonalization and corollaries
Cardinals/LeastCardinalsEns.v the cardinal orders are well-founded
Classical_Wf.v - proofs of the classical equivalence of wellfoundedness, the minimal element property, and the descending sequence property
CSB.v - the Cantor-Schroeder-Bernstein theorem
DecidableDec.v - classic_dec: forall P: Prop, {P} + {~P}.
DependentTypeChoice.v - choice on a relation (forall a: A, B a -> Prop)
DirectedSets.v - basics of directed sets
Filters.v - basics of filters
EnsembleProduct.v - products of ensembles, living in the type A * B
EnsemblesImplicit.v - settings for appropriate implicit parameters for the standard library's Ensembles functions
FiniteImplicit.v - same for the standard library's Sets/Finite_sets
ImageImplicit.v - same for the standard library's Sets/Image
Relation_Definitions_Implicit.v - same for the standard library's Relation_Definitions
EnsemblesExplicit.v - clears the implicit parameters set in the above files
EnsemblesSpec.v - defines a notation for e.g. [ n: nat | n > 5 /\ even n ] : Ensemble nat.
EnsemblesTactics.v - defines tactics that help in proofs about Ensembles
EnsemblesUtf8.v - optional UTF-8 notations for set operations
Families.v - operations on families of subsets of X, i.e. Ensemble (Ensemble X)
IndexedFamilies.v - same for indexed families A -> Ensemble X
FiniteIntersections.v - defines the finite intersections of a family of subsets
FiniteTypes.v - definitions and results about finite types
CountableTypes.v - same for countable types
InfiniteTypes.v - same for infinite types
FunctionProperties.v - injective, surjective, etc.
FunctionProperitesEns.v - same but definitions restricted to ensembles
Image.v - images of subsets under functions
InverseImage.v - inverse images of subsets under functions
Ordinals.v - a construction of the ordinals without reference to well-orders
Powerset_facts.v - some lemmas about the operations on subsets that the stdlib is missing
Proj1SigInjective.v - inclusion of { x: X | P x } into X is injective
Quotients.v - quotients by equivalence relations, and induced functions on them
ReverseMath - a folder with some results in constructive reverse mathematics
WellOrders.v - some basic properties of well-orders, including a proof that Zorn's Lemma implies the well-ordering principle
ZornsLemma.v - proof that choice implies Zorn's Lemma
Rocq Prover
99.8%