## Posts Tagged ‘formalized mathematics’

### IsarMathLib 1.27.0: Spectrum of a quotient ring, Finite State Machines

March 18, 2023

This release is again mostly based on contributions by Daniel de la Concepción Sáez in algebraic topology (or is it algebraic geometry? I am not sure), automata theory and formal languages.

The content in ring theory provides results on the spectrum of a quotient ring and reaches the result that the spectrum of a quotient ring is homeomorphic to a closed subspace of the spectrum of the original ring (in Zariski topology).

I have to say Daniel’s new theory on Finite State Machines was quite a surprise for me as the subject is quite far away from what I associate with mathematics that is easy to formalize is set theory. The material reaches the proof that non-deterministic finite state automata determine the same languages as deterministic finite state automata.

### IsarMathLib 1.26.0: Ring ideals and Zariski topology

January 30, 2023

This is a relatively large release with new material on algebra and algebraic topology contributed by Daniel de la Concepción Sáez. The full list of topics covered and not covered (yet) is in this GitHub issue. It will take some time before the new theory files are presented on the isarmathlib.org site, in the meantime they can be viewed in the standard Isabelle generated HTML presentation, the outline (definitions and assertions only) or the full proof document with proofs.

## What is Zariski topology?

Let $\mathcal{I}$ be the set of ideals of some commutative ring and $\mathcal{S}$ be the set of prime ideals (i.e. the spectrum) of that ring. As it turns out the collection $\tau_Z = \{\{P \in \mathcal{S}: \neg (I \subseteq P)\}:I \in \mathcal{I} \}$ is then a topology, called Zariski topology. The carrier of this topology is $\bigcup \tau_Z = \mathcal{S}$ and the closed sets are of the form $\{ P \in \mathcal{S} : I \subseteq P\}$ for $I\in \mathcal{I}$. So this notion belongs to algebraic topology but unlike for the topological groups or rings the topological structure is completely derived from the algebraic structure. Each ring has its Zariski topology.

### IsarMathLib 1.25.0: Comparison with Metamath

December 28, 2022

Around 2007 at the beginning of the project I got an idea to speed up the development of the IsarMathLib library by importing theorems from Metamath’s set.mm. The theorems and proofs translated then are still a part of IsarMathLib and a small sample is presented at the isarmathlib.org site. After translating about 2000 proofs I decided to stop doing that as the work was repetitive and boring and the resulting proofs were not readable.

Metamath is considered a “low level” language and proof assistant, so I recently got curious how the Metamath proofs would compare with similar proofs written in the Isar dialect used in IsarMathLib. In this release I manually translated the Metamath’s utopreg theorem together with a couple of dependencies, taking advantage of Isabelle automation features to the extend I usually do in IsarMathlib. The following table compares verbosity of the original and translated proofs for the theorems whose proofs expressed similar ideas:

On average IsarMathLib proofs were about 2.3 times shorter. I have to say I expected that factor to be somewhere between 3 and 4.

The original Metamath utopreg theorem states that all Hausdorff uniform spaces are regular. After I translated the proof I was surprised to notice that the IsarMathLib’s version does not reference the hypothesis that the uniform space is Hausdorff. So, the IsarMathLib version shows that all uniform spaces are regular. I am not sure how it happened. To be honest I was not able to follow the Metamath proof exactly – it’s just too many small steps for me to put in my head at the same time. I was translating the proofs by first showing the steps marked green in Metamath Proof Explorer (I understand this indicates that the theorem referenced in the step is recent and hence close to the one being shown). Then I looked at facts made available this way and tried to figure out how one can get to the thesis of the theorem from them. It is possible that the Metamath proof does not make real use of this hypothesis as well, it’s just easier to spot in Isar.

### IsarMathLib 1.24.0: Update to Isabelle2022

October 29, 2022

A new version of Isabelle got released a couple of days ago and this version updates IsarMathLib to Isabelle2022. The Isabelle/ZF logic that IsarMathLib is based on is not actively developed, which has a good side that there are no changes and upgrades like this are easy and problem-free.

There is a little bit of formalized mathematics added in this IsarMathLib release as well. I added a couple of results from general topology that I always considered neat and elegant: a characterization of Hausdorff spaces as those for which the diagonal $\{\langle x,x\rangle : x\in X\}$ is closed in the product topology on $X\times X$, the fact that the graph of a function into a Hausdorff space is closed in $X\times X$ and that two continuous functions into a Hausdorff space are equal on a closed set.

Another theorem added is related to abstract neighborhood systems. IsarMathLib had had a formalization of the fact that if one has a neighborhood system on $X$ one can construct a topology on $X$ and vice versa: starting from a topology we can define a natural neighborhood system. In this release I added a theorem asserting that if we start from a neighborhood system, create a topology from it, then create it’s natural neighborhood system, we get back the original neighborhood system.

### IsarMathLib 1.23.0: Rewrite of the presentation layer in F#

September 5, 2022

I wrote the original isar2html tool 13 years ago in Haskell as a way to learn the language. Since then I was extending it and fixing bugs. Coming back once or twice a year to a language that I was not using professionally had quite a bit of overhead just to recall how the things worked and reconstruct the development environment. As it happened I changed jobs in April this year and the new job required F#, so I decided to rewrite isar2html in F#, again as a way to learn the language. Of course as usual with that type of “big rewrite” (well, not that big here really) projects I underestimated the effort needed so I finished only about a week ago. Now I have exactly the same application implemented the same way in Haskell i F#.

The F# syntax is not as clean as Haskell’s so it was a surprise for me that the number of lines required was about 16% less in F# than in Haskell. Still, I would say that F# is slightly more verbose as the total number of characters was 10% higher in F#. Translating the parser of the subset of the Isar formal proof language that is used in IsarMathLib was almost mechanical and boring thanks to FParsec, which is the F# clone of Haskell’s Parsec parser library. I am especially happy with the result of that part of the project – the parsing errors were difficult to debug in Haskell. FParsec has better diagnostics built in – in case of failure it shows the backtracking information which helps a lot to pinpoint the problem in the text being parsed.

On the mathematics side in this release I have added a theorem stating that an ordered loop valued metric space is T2.

(more…)

### IsarMathLib 1.22.0: Uniform covers part II

October 5, 2021

The material added in this release is again about uniform spaces, more specifically about the equivalence of defining uniform space through (diagonal) uniformities and through uniform covers. The previous release concluded with the theorem stating that if $\Theta$ is a family of uniform covers of $X$ then the following collection $\Phi$ of subsets of $X\times X$ is a (diagonal) uniformity:

$\Phi = \{A\in Pow(X\times X): \exists_{P\in \Theta} \bigcup\{U\times U: U\in P\} \subseteq A\}$.

This shows that if we define a uniform space through a family of uniform covers then we can always get the usual definition by transforming that family into a uniformity.

The current release adds the dual fact (unicov_from_uniformity): if $\Phi$ is a uniformity on $X$ then the following collection of covers of $X$ is a family of uniform covers:

$\{P\in \text{Covers}(X). \exists_{A\in \Phi} \forall_{x\in X} \exists_{U\in P} A\{x \} \subseteq U\}$.

The next two theorems show that these two transformations are inverses of each other.

I should probably quote sources for my formalization so that not to create an impression that I claim I am inventing some new stuff here. However the truth is that I found the Willard’s “General Topology” book that I bought for this nearly useless. So I ended up mostly getting definitions and facts from the “Uniform cover definition” section on the Wikipedia page on uniform spaces, and figuring out the proofs by myself. The only exception was a nice (even if not completely correct) proof that barycentric refinement of a barycentric refinement is a star refinement by Henno Brandsma that I found on Stack Exchange and converted to the bary_bary_star lemma.

## Other news

(more…)

### IsarMathLib 1.21.0: Uniform covers

August 22, 2021

There are three approaches to defining uniform spaces. The first one, through diagonal uniformities is presented in IsarMathLib in the UniformSpace_ZF theory. This release adds a theory about defining uniform spaces through uniform covers.

Consider a set $X$ with its powerset (the set of subsets) $\text{Pow}(X)$. A collection $P$ of subsets of $X$ whose union is equal to $X$ is called a cover of $X$. So, we can define the set $\text{Covers}(X) = \{ P\in \text{Pow}( \text{Pow} (X)): \bigcup P =X \}$.

For a set $U\subseteq X$ and a collection of $\mathcal{U}$ of subsets of $X$ we can define the star of $U$ in $\mathcal{U}$ as $\text{st}(U,\mathcal{U}) = \bigcup\{ W\in \mathcal{U} : W\cap U\ne \emptyset \}$.

For two covers $\mathcal{R},\mathcal{C} \in \text{Covers}(X)$ we say that the cover $\mathcal{R}$ is a star-refinement of the cover $\mathcal{C}$ and write $\mathcal{R} <^* \mathcal{C}$ if for every $R\in \mathcal{R}$ we can find a $C\in \mathcal{C}$ such that $\text{st}(R, \mathcal{R})$ is contained in $C$.

Finally we are able to define uniform covers. This notion is a bit tricky as there is really no separate notion of a uniform cover. If we look at cover of $X$ we cannot say if this is a uniform cover or not. What actually is defined is a family of uniform covers. A member of such family can only be called a uniform cover if it is clear from the context what family of uniform covers it belongs to.

A nonempty collection of covers $\Theta$ of $X$ is called a family of uniform covers iff the following two conditions hold:

a) If $\mathcal{R} \in \Theta$, $\mathcal{C} \in \text{Covers}(X)$ and $\mathcal{R} <^* \mathcal{C}$, then $\mathcal{C} \in \Theta$

b) For every two covers $\mathcal{R}, \mathcal{C}\in \Theta$ we can find a cover $\mathcal{D}\in \Theta$ that is a star-refinement of both $\mathcal{R}$ and $\mathcal{C}$

This definition is slightly different that the one on the Wikipedia page on uniform spaces, which specifically requires that the trivial cover $\{ X\}$ is a member of $\Theta$. However, since every cover is a star-refinement of the trivial cover $\{ X\}$ and $\Theta$ is not empty, condition a) implies that $\{ X\}\in \Theta$.

The key fact here is that if $\Theta$ is a family of uniform covers of $X$ then the following collection $\Phi$ of subsets of $X\times X$ is a (diagonal) uniformity:

$\Phi = \{A\in Pow(X\times X): \exists_{P\in \Theta} \bigcup\{U\times U: U\in P\} \subseteq A\}$

In words, $\Phi$ is the collection of supersets of sets of the form $\bigcup\{U\times U: U\in P\}$ as $P$ ranges over $\Theta$.

In Willard’s “General Topology” book the proof that $\Phi$ is a uniformity is left as a “straightforward exercise” for the reader. Typically that means that the proof is long and tedious and the author does not feel like typing all that down. In this case the proof is indeed of mostly straightforward “follow your nose” kind right up to the moment when given a set $A\in \Phi$ one needs to find a set $B\in \Phi$ such that $B\circ B \subseteq A$ (here $B\circ B$ is the composition of relation $B$ with itself). For that, I found the following identity useful:

$( \bigcup\{U\times U: U\in P\} ) \circ ( \bigcup\{U\times U: U\in P\} ) = \bigcup\{U\times \text{st}(U,P): U\in P\}$

It took me some effort to figure out this identity and I was ready to type the proof of that in Isabelle, split into two inclusions etc. To my amazement though Isabelle accepted this fact without an explicit proof, only with the reference to the definition of star. This was probably the most unclear to me fact that was obvious to Isabelle that I have seen writing proofs for IsarMathLib so far. I left the proof of this identity as an exercise for the reader. This time the straightforwardness of this fact got certified by Isabelle.

Which brings us to the subject of

## Automation in proof assistants

(more…)

### IsarMathLib 1.19.0: Loops

April 6, 2021

This release adds a theory file about loops. Loops (the kind we talk about here, not to be confused with for example loop algebras) are algebraic structures that are almost like groups, except that we don’t require the operation to be associative. Wikipedia has a nice picture illustrating dependencies between various algebraic structures between magmas and groups which I copy below:

As the picture shows we get a loop when we take a quasigroup and require that an identity (a neutral element of the operation) exists. It can be shown that that identity is unique in the loop. If we denote the loop identity as $e$, then we can define the left and right inverses of a loop element $a$ as the only solutions to the equations $x\cdot a = e$ and $a\cdot x = e$. In a loop these inverses do not have to be the same in general. If the loop operation is associative then we get a group and the left and right inverses unify to become the group inverse.

### IsarMathLib 1.18.0: Quasigroups

March 24, 2021

A quasigroup is a set with a binary operation (usually written with the multiplicative notation) that supports a certain kind of “divisibility”: every equation of the form $a\cdot x = b$ or $x\cdot a = b$ has a unique solution. So, a quasigroup is like a group except we do not require associativity or existence of a neutral element. If we denote those solution as $a\backslash b$ and $b/a$ respectively we get the identities $a\cdot (a\backslash b) = b$ and $(b/a)\cdot a = b$ by definition and, with the uniqueness, we get $a\backslash (a\cdot b) = b$ and $(b\cdot a)/a =b$, which may serve as an alternative definition of quasigroup.

According to this paper “One of the mathematical subfields where automated theorem provers are heavily used is the field of quasigroup and loop theory”.

### IsarMathLib 1.17.0: Real numbers as a metric and topological space

March 7, 2021

In this release I added a new theory about real numbers. It’s mostly about setting up notation and validating other contexts (related to ordered fields, rings, groups, metric spaces etc.) so that theorems formulated in those contexts can be used when considering real numbers. At the end there are two theorems about the distance function $(x,y) \mapsto |x-y|$ being a metric and one stating that the collection of unions of open disks is a topology on reals.

IsarMathLib had been upgraded to Isabelle2021 in the previous release 1.16.1 (not announced on this blog) but at that time I didn’t notice that the proof documents were not generated properly. The pdf files generated by Isabelle didn’t get the formal text right, some symbols (like $\{$ and $\}$, very important in mathematics based on set theory) were replaced by some placeholder symbol. Errors related to LaTeX are difficult to debug in Isabelle (at least for me), but this time I was lucky. The Isabelle2021 release notes contained information that the “The standard LaTeX engine is now lualatex, according to settings
variable ISABELLE_PDFLATEX.” . Indeed changing the ISABELLE_PDFLATEX="lualatex --file-line-error" line in the settings file back to ISABELLE_PDFLATEX="pdflatex -file-line-error" like it was in Isabelle2020 fixed the problem.

(more…)