Fixed Points Theorems for Non-Transitive Relations

In this paper, we develop an Isabelle/HOL library of order-theoretic fixed-point theorems. We keep our formalization as general as possible: we reprove several well-known results about complete orders, often with only antisymmetry or attractivity, a mild condition implied by either antisymmetry or transitivity. In particular, we generalize various theorems ensuring the existence of a quasi-fixed point of monotone maps over complete relations, and show that the set of (quasi-)fixed points is itself complete. This result generalizes and strengthens theorems of Knaster-Tarski, Bourbaki-Witt, Kleene, Markowsky, Pataraia, Mashburn, Bhatta-George, and Stouti-Maaden.


Introduction
Fixed-point theorems are of fundamental importance in computer science, such as in denotational semantics [24] and in abstract interpretation [11], as they allow the definition of semantics of loops and recursive functions. The Knaster-Tarski theorem [27] shows that any monotone map f : A → A over a complete lattice (A, ) has a fixed point, and the set of fixed points also forms a complete lattice. The result was extended in various ways.
• Relaxing completeness assumptions: Abian and Brown [1,Theorem 2] proved the existence of fixed points under a more general completeness assumption, which is nowadays called a weak chain-complete poset [5]. Markowsky [20] showed that, for chain-complete posets, the set of fixed points are again chain-complete. Markowsky's proof uses the Bourbaki-Witt theorem (see below), whose original proof is non-elementary in the sense that it relies on ordinals and Hartogs' theorem. Pataraia [23] gave an elementary proof of the existence of least fixed points for pointed directed-complete posets. • Relaxing order assumptions: Fixed points are studied also for pseudo-orders [25], relaxing transitivity. Bhatta and George [4,5] gave a non-elementary proof showing that the set of fixed points over weak chain-complete pseudo-orders is again weak chain-complete. Stouti and Maaden [26] showed that every monotone map over a complete pseudo-order has a (least) fixed point, with an elementary proof. • Alternative to monotonicity: Another line of research on fixed points is to consider inflationary maps rather than monotone ones. The Bourbaki-Witt theorem [8] states that any inflationary map over a chain-complete poset has a fixed point, and its proof is non-elementary as already mentioned. Abian and Brown [1,Theorem 3] also gave an elementary proof for a generalization of the Bourbaki-Witt theorem applied to weak chain-complete posets. • Iterative approach: One last line of research on fixed points we would like to mention is the iterative approach. Kantorovitch showed that for any ω-continuous map f over a complete lattice, 1 the iteration ⊥, f ⊥, f 2 ⊥, . . . converges to a fixed point [18, Theorem I].
Tarski [27] also claimed a similar result for a countably distributive map over a countably complete lattice. Kleene's fixed-point theorem states that, for Scott-continuous maps over pointed directed-complete posets, the iteration converges to the least fixed point. Finally, Mashburn [21] proved a version for ω-continuous maps over ω-complete posets, which covers Kantorovitch's, Tarski's and Kleene's results.
In this paper, we formalize these fixed-point theorems in a general form, using the proof assistant Isabelle/HOL [22]. The use of proof assistants such as Coq [10], Agda [9], HOL-Light [16], and Isabelle/HOL, are exemplified prominently by a proof of the four-colour theorem in Coq [12], a proof of the Kepler conjecture in discrete geometry in HOL-Light and Isabelle [15], a formal verification of an OS microkernel in Isabelle/HOL [19], etc., where proofs are so big that human reviewing would not be able to verify the correctness of the proofs within a reasonable time. In this work, we utilize another aspect of proof assistants: they are also engineering tools for developing mathematical theories. In particular, Isabelle/JEdit [28] is a very smart environment for developing theories in Isabelle/HOL. There, the proofs we write are checked "on the fly", so that one can easily refine proofs or even theorem statements by just changing a part of it and see if Isabelle complains or not. Sledgehammer [7] can often automatically fill relatively small gaps in proofs so that we can concentrate on more important aspects. Isabelle's counterexample finders [3,6] should also be highly appreciated, considering the amount of time one would spend trying in vain to prove a false claim.
We adopt an as-general-as-possible approach: all theorems are proved without assuming the underlying relations to be orders. One can easily find several formalizations of complete partial orders or lattices in Isabelle's standard library. They are, however, defined on partial orders and thus not directly reusable for general relations.
In particular, we provide the following: • Several locales [17,2] that help organizing the different order-theoretic conditions, such as reflexivity, transitivity, antisymmetry, and their combinations, as well as concepts such as connex and well-related sets, analogues of chains and well-ordered sets in a non-ordered context (Section 1). • Existence of fixed points: We provide two proof methods for proving that a monotone or inflationary mapping f : A → A over a complete related set (A, ) has a quasi-fixed  -POINT THEOREMS FOR NON-TRANSITIVE RELATIONS  30:3 ordering assumptions, but relies on completeness with respect to all subsets. The second one (Section 3), inspired by a constructive approach by Grall [13], is a proof method based on the notion of derivations. For this method, we demand antisymmetry (to avoid the necessity of the axiom of choice), and the statement can then be instantiated to well-complete sets, a generalization of weak chain-completeness. This also allows us to generalize the Bourbaki-Witt theorem [8] to pseudo-orders. • Completeness of the set of fixed points (Section 4): We further show that if (A, ) satisfies a mild condition, which we call attractivity and which is implied by either transitivity or antisymmetry, then the set of quasi-fixed points inherits the completeness class of (A, ), if it is at least well-complete. The result instantiates to the full completeness (generalizing Knaster-Tarski and [26]), directed-completeness [23], chain-completeness [20], and weak chain-completeness [5]. • Iterative construction (Section 5): For an ω-continuous map over an ω-complete related set, we show that suprema of {f n ⊥ | n ∈ N} are quasi-fixed points. Under attractivity, the quasi-fixed points obtained from this method are precisely the least quasi-fixed points of f . This generalizes Mashburn's result, and thus ones by Kantorovitch, Tarski and Kleene.
The formalization is available in the Archive of Formal Proofs [29]. We can easily ensure that our development indeed does not use the axiom of choice, by the fact that Isabelle validates the proofs only by loading basic HOL libraries, excluding the axiom of choice (HOL.Hilbert_Choice).
We remark that all these results would have required much more effort than we spent (if possible at all), if we were not with the aforementioned smart assistance of Isabelle. Our workflow was often the following: first we formalize existing proofs, try relaxing assumptions, see where the proof breaks, and at some point ask for a counterexample. We also observe that a carefully chosen use of notations and locales lets us do mathematics in Isabelle without going too far beyond daily mathematics.
Comparison with [30]. The present paper is built upon authors' work [30] presented at ITP'19, but the entire formalization went through an overhaul. Formalizations of Section 1.2, the proof of existence of quasi-fixed points using well-completeness (Section 3), and most of the proof of completeness of the set of (quasi-)fixed points (Section 4) are new materials. The rest has been accommodated to fit with this new material, as well as to make better notations, proof structures, etc.

Preliminaries
We develop our theory in Isabelle/HOL and present statements following its notation. Here we briefly explain notions and notations needed for the paper. We refer interested readers to the textbook [22] for more detail. In Isabelle, =⇒ and −→ denote the logical implication. 2 Function application is written f x. By A :: 'a set we denote a set A whose elements are of type 'a, and R :: 'a ⇒ 'a ⇒ bool is a binary predicate defined over 'a. Type annotations ":: _" are omitted unless necessary. Now we introduce several notions that will be needed to state and prove fixed-point theorems. We call the pair (A, ) of a set A and a binary relation ( ) over A a related set. One could also call it a graph or an abstract reduction system, but then some terminologies Hereafter, we write ( ) for the dual of ( ): x y ≡ y x, and {x ∈ A. P x} is one of the Isabelle/HOL notations for set comprehension, {x ∈ A | P x} in daily mathematics.
We can already prove some useful lemmas. For instance, if f : I → A is relation preserving and I has a greatest element e ∈ I, then f e is a supremum of the image of I by f , denoted by f`I following Isabelle notations. Note here that no assumption is imposed on the relations ( ) and ( ).
lemma monotone_extreme_imp_extreme_bound: assumes "f`I ⊆ A" and "monotone_on I ( ) ( ) f " and "extreme I ( ) e" shows "extreme_bound A ( ) (f`I) (f e)" 1.1. Locale Hierarchy of Relations. We now define basic properties of binary relations, in form of locales [17,2]. Isabelle's locale mechanism allows us to conveniently manage notations, assumptions and facts. For instance, we introduce the following locale for infix notation of a related set.
locale related_set = fixes A :: "'a set" and less_eq :: "'a ⇒ 'a ⇒ bool" (infix " " 50) The most important feature of locales is that we can impose assumptions on parameters. For instance, we define a locale for reflexive relations as follows.
This declaration is logically equivalent to defining predicate "reflexive" with the following equation: Vol Compared to just defining a predicate, declaring a locale will introduce a named context where we can collect facts and give them attributes to guide Isabelle's automation when proving theorems in the locale. For instance, the "[intro]" attribute above instructs Isabelle to use the assumption refl as an introduction rule in proof automation. Below are some examples proved in locale reflexive: Similarly we define transitivity and antisymmetry: Another merit of using locales is that it is straightforward to combine assumptions. Some well-known combinations are quasi-ordered (also sometimes called pre-ordered) sets for reflexive and transitive relations and partially ordered sets (posets) for antisymmetric quasi-ordered sets.
locale quasi_ordered_set = reflexive + transitive locale partially_ordered_set = quasi_ordered_set + antisymmetric A less known but convenient assumption is being a pseudo-order, coined by Skala [25] for reflexive and antisymmetric relations. There, the supremum of a singleton set {x} uniquely exists-x itself.
It is clear that a partial order is also a pseudo-order, which is stated by the following sublocale declaration.
This declaration is logically equivalent to proving the fact: The difference is that, after the sublocale declaration, facts proved in pseudo_ordered_set will be automatically available in partially_ordered_set.
Although these combinations are sufficient for the rest of this paper, we also present all locales combining these basic properties and their relationships in Figure 1.
Readers already familiar with Isabelle/HOL might question why we use locales instead of classes. Indeed, Isabelle/HOL already has a class that introduces the order symbol ≤. One of the drawbacks of this approach is that we cannot restrict our interest to the set A but we are forced to work with UNIV. Another drawback is that one type must have one order, which forbids our results to be instantiated to other relations on the same type. Our  Figure 1. Combinations of basic properties. The five outgoing arrows from related_sets indicate atomic assumptions. We do not present the combination of reflexive and irreflexive, which is empty, and one of symmetric and antisymmetric, which is a subset of equality. Node "¬tolerance" indicates the negated relation is tolerance, and "∅" is the empty relation.
approach, making the relation of concern explicit as an argument, is sometimes called the dictionary-passing style [14]. On one hand this design choice adds a notational burden, but on the other hand it allows instantiating results to arbitrary relations over a type, for which the class mechanism fixes one ordering. In the formalization we also import our results into the class hierarchy, by taking A = UNIV and ( ) = (≤).

Well Related Sets.
A well-ordered set is a poset (A, ) such that every nonempty subset of A has a least element. We generalize the notion to well-related set, which does not assume posets: Every well-related set is connex, i.e., any two elements are comparable.
The set {x, y} has a least element, so x y or y x.
It is also easy to see that connexity implies reflexivity: A crucial observation is that every well-related set is well-founded, that is, the asymmetric part of ( ) defined by x y ≡ x y ∧ y x satisfies the induction principle: The proof is easy, using the classical result that well-foundedness is equivalent to assuming that every nonempty X ⊆ A has a minimal element; least elements are also minimal. We remark that under antisymmetry, well-relatedness and well-orderedness are equivalent. We just define well-ordered sets as antisymmetric well-related sets, and prove that they are actually posets.
Proof. Since well-related sets are connex and thus reflexive, and since we explicitly assume antisymmetry, it only remains to show that (A, ) is transitive. 3 So fix x, y and z ∈ A with x y and y z, and let us prove that x z. By well-relatedness, the set {x, y, z} has an extreme element l. There are three possible cases: • If l = x, then by extremality x = l z.
• If l = y, then by extremality y = l x, and by antisymmetry x = y z.
• If l = z, then by extremality z = l y, and by antisymmetry x y = z.

Existence of Fixed Points in Complete Related Set
In this section we focus on the strongest completeness assumption UNIV-complete, i.e., any subset of elements has a (not necessarily unique) supremum, and further generalize Stouti and Maaden's result so that it works on complete related sets, relaxing even reflexivity and antisymmetry. Much as in the Bourbaki-Witt theorem, we also generalize the monotonicity assumption to allow inflationary maps, that is, maps such that x f x for all x.
Notice that UNIV-complete does not explicitly demand infima, in Isabelle, "∃i. extreme_ bound A ( ) X i". This is a well-known consequence in complete lattices, namely that infima can be defined in terms of suprema as greatest lower bounds, and luckily the proof does not rely on any property of orders. This allows us to state that UNIV-complete is auto-dual in the following sense: In the rest of the section, our goal is to prove that a monotone or inflationary map on an UNIV-complete set has a fixed point, following closely the proof by Stouti and Maaden [26]. The structure will be the same as their proof, only accommodating some arguments to fit our general framework.
First we just assume completeness and analyze the existence of fixed points. Fortunately, Quickcheck [3] quickly refutes the existence of strict fixed point f x = x even when f is monotone and inflationary.

Example 2.1 (by Quickcheck). Let
Hence, we instead show the existence of a quasi-fixed point f x ∼ x, that is, f x x and x f x. The set of quasi-fixed points is included in the set of fixed points for antisymmetric relations -the inclusion can be strict without reflexivity; hence the Stouti-Maaden theorem is further generalized by relaxing reflexivity. Moreover, we develop an existence theorem that generalizes both monotone and inflationary f , namely, quasi-fixed points exist if f : A → A is monotone or inflationary at each point: We develop proofs within the following locale, 4 so that we can refer to them in the proofs of later theorems: We follow Stouti and Maaden's proof [26]; one of their insights is in considering the set of subsets of A that are closed under f and themselves "complete": Here we slightly modified Stouti and Maaden's definition: by a "complete" subset B ⊆ A we mean that any supremum with respect to (A, ) is in B, since suprema are not necessarily unique without antisymmetry. We denote the intersection of all those subsets by C: and show that a supremum of C, which exists due to completeness, is a quasi-fixed point.
The proof basically follows that by Stouti and Maaden, but after formalizing their proof we noticed that the monotonicity condition can be generalized with a tiny modification.
lemma qfp_as_extreme_bound: • completeness: given X ⊆ C and its supremum s in A, we prove s ∈ C, that is, s ∈ B for every B ∈ A. Indeed, we have X ⊆ C ⊆ B and the completeness of B ensures s ∈ B. This implies that c ∈ C. Moreover, since f`C ⊆ C, we have f c ∈ C, and since c is a supremum of C, we get f c c. It remains to prove the converse orientation c f c. This inequality is obvious when f is inflationary at c, so let us focus on the case when f is monotone at c, that is, ∀d ∈ A. d c −→ f d f c. To this end we consider the following set D: The assumption f`A ⊆ A could be equivalently written f : A → A in Isabelle; unfortunately, the latter notation in the Isabelle/HOL library automatically enables the axiom of choice. We conclude by proving that D ∈ A, since this implies C ⊆ D and in particular c ∈ D, which means c f c.
With the monotonicity assumption we get f d f c and thus f d ∈ D. • completeness: Given E ⊆ D and its supremum s in A, we prove that s ∈ D. Since E ⊆ D ⊆ C, then by completeness of C, s ∈ C. Additionally, since E ⊆ D, f c is a bound of E, and as s is a least of such, s f c, that is s ∈ D.
This general lemma allows us to conclude that if (A, ) is complete for a notion of completeness that includes the subset C, then f has a quasi-fixed point given by the existing supremum c of C. This is enforced in particular when (A, ) is UNIV-complete: This result generalizes one in our previous work [30], where the monotonicity condition is generalized so that inflationary maps are also covered. It is easy to see that this result indicates the existence of a strict fixed point if (A, ) is antisymmetric and UNIV-complete.
The result covers Stauti and Maaden's existence theorem, with generalized monotonicity condition and without the reflexivity assumption.

Fixed Points in Well-Complete Antisymmetric Sets
Let us say that a related set (A, ) is well-complete if every well-related subset of A, including the empty set, has a supremum. In Isabelle, Well-completeness is a generalization of weak chain-completeness (named so in [4], but already used in [1]), which assumes that every well-ordered subset has a supremum. Recall that in the presence of antisymmetry, well-relatedness and well-orderedness coincide, and that so do well-completeness and weak chain-completeness. In this section, we prove that every inflationary or monotone map over a well-complete antisymmetric set has a fixed point. This generalizes Bhatta and George's existence of fixed points [4] by removing reflexivity. This result will be further generalized in Section 4. In order to formalize such a theorem in Isabelle, we followed Grall's [13] elementary proof for Bourbaki-Witt and Markowsky's theorems. His idea is to consider well-founded "derivation trees" over A, where from a set C ⊆ A of premises one can "derive" f ( C) if C is a chain. The main observation is as follows: Let D be the set of all the derivable elements; that is, for each d ∈ D there exists a well-founded derivation whose root is d. It is shown that D is a chain, and hence one can build a derivation yielding f ( D), and f ( D) is shown to be a fixed point. This idea is also very similar to the proof in [1], where the notion of a-chain is analogue to derivations in Grall's proof.
The unique well-order derivation Figure 2. Approaches for deriving We started formalizing his proof smoothly in Isabelle/HOL, until the point of building a derivation tree containing all derivable elements. There, it appears to us that the axiom of choice is necessary: we need to choose one derivation for each derivable element, and then aggregate into one derivation. Note that a derivable element may have infinitely many well-founded derivations (Figure 2a).
Of course, the axiom of choice is available in Isabelle/HOL, but we found a way to avoid using it. We utilize the following lemma, stating that the union of (infinitely many) downward-closed well-founded sets is well-founded.
lemma closed_UN_well_founded: assumes "∀X ∈ X . well_founded X ( ) ∧ (∀x ∈ X. ∀y ∈ X . y x −→ y ∈ X)" shows "well_founded ( X ) ( )" Proof. We show that any nonempty S ⊆ X has a minimal element. Let x ∈ S. Then there exists X ∈ X such that x ∈ X. Due to the assumption on X , (X, ) is well-founded. Hence, since S ∩ X ⊆ X is nonempty containing x, S ∩ X has a minimal element z. We show that z is also minimal in S by contradiction. So suppose that y ∈ S with y z exists. Since y ∈ S ⊆ X , by the assumption on X and z ∈ X we get y ∈ X. Then with y ∈ S we get y ∈ S ∩ X and y z, which is not possible since z is minimal in S ∩ X.
We apply this lemma with the collection of derivations as X . To this end we carefully define derivations so that any derivable element determines its down-set (see Figure 2b). This led to the following definition: First, note that we demand that a derivation is well-ordered not just well-founded. This deviation does not make essential difference since any derivation is proven to be connex in Grall's approach. Second, we demand that every x in a derivation X is "derived" from its predecessors X↓x ≡ {y ∈ X. y x} as either • a successor : X↓x has a greatest element y and x = f y, or • a limit: X↓x is closed under f and x is a supremum of X↓x.
The closure condition in the limit case is the key trick to ensure the uniqueness of the down-set. In the coming Section 3.1 we provide a general condition which ensures the existence of a fixed point. Afterwards we instantiate the condition to obtain generalizations of the context assumes derivation_infl: "∀X x y. derivation X −→ x ∈ X −→ y ∈ X −→ x y −→ x f y" and derivation_f_refl: "∀X x. derivation X −→ x ∈ X −→ f x f x" and "antisymmetric A ( )" We will show that monotone maps satisfy the first two conditions. At this point we require antisymmetry: incomparable successors may be derived from distinct limits, destroying connexity. Indeed, suppose that x is derivable, obtained from the successor case x = f z with z being a greatest element of X↓x, and u is another greatest element of X↓x. Then we expect f u to be derivable, but it is possible that f u and x are incomparable (remember that, although u ∼ z, we do not assume monotonicity at this point). Nevertheless the condition will be relaxed to a milder condition in a later section.
The following lemma is derived from Grall's proof. We simplify the claim so that we consider two elements from one derivation, instead of two derivations.
lemma derivation_useful: assumes "derivation X " and "x ∈ X " and "y ∈ X " and "x y" shows "f x y" Proof. This is done by proving the following stronger claim: by induction on x ∈ X, and then on y ∈ X. Remember that induction on elements of X is possible because derivations are well-related and thus well-founded. Let us present a proof only for the case where x y. The case y x is similar, while the induction hypothesis on x is used instead of y. The proof continues by case distinction on y ∈ X, namely, whether it is a successor or a limit.
• Successor case: Suppose that there is a greatest element u in X↓y and y = f u. Since X is antisymmetric and connex, only the following three comparisons x and u are possible: x u: Using the induction hypothesis on u y, we know that f x u. Since u ∈ X, by derivation_infl, f x f u = y. x = u: we have f x = y so f x ∈ X, and since (X, ) is well-ordered and thus reflexive, f x = y y. u x: By the induction hypothesis on u x, we have y = f u x. However, by assumption x y, and so y x, which is impossible.
• Limit case: Suppose that X↓y is closed under f and y is its supremum. Since x y we have x ∈ X↓y, and since X↓y is closed, f x ∈ X↓y. This means f x ∈ X and f x y.
The next one is the main lemma of this section, stating that elements from two possibly different derivations are comparable, and moreover the lower one is in the derivation of the upper one. The latter claim, not found in Grall's proof, is crucial in proving that the union of all derivations is well-related.

J. Dubut and A. Yamada
Vol. 18:1 lemma derivations_cross_compare: assumes "derivation X " and "derivation Y " and "x ∈ X " and "y ∈ Y " Proof. The proof is conducted by induction on x ∈ X and then on y ∈ Y . We prove (y x ∧ y ∈ X) ∨ x y using the induction hypothesis on x: for any z ∈ X↓x. The symmetric statement is proved similary using the induction hypothesis on y, which allows us to conclude the proof. We proceed by case distinction on x. • Successor case: Suppose that X↓x has a greatest element z and x = f z. By IHx we have the following three possibilities: z y and z ∈ Y : by derivation_useful in Y applied to z y, we obtain that x = f z y.
z = y: since z ∈ X↓x, we know y x and y ∈ X.
y z and y ∈ X: since z ∈ X↓x, we have z x, and since (X, ) is a well-order, y z x implies y x.
• Limit case: Suppose that X↓x is closed under f and x is its supremum. Let us prove our claim by the following case distinction: -Suppose that there exists z ∈ X↓x such that y z. By IHx we have y ∈ X. Furthermore, since (X, ) is a well-order, y z x implies y x. -Otherwise, for every z ∈ X↓x, we have y z. So by IHx we have z y for all z ∈ X↓x, that is, y is a bound of X↓x. Since x is least among such bounds, we conclude x y.
We say an element is derivable if there exists a derivation X containing it.
definition "derivable x ≡ ∃X. derivation X ∧ x ∈ X " Lemma derivations_cross_compare ensures that any two derivable elements are comparable, and that the set of derivations are downward closed, as in the assumptions of Lemma closed_UN_well_founded. We then conclude that the set of derivable elements {x. derivable x} = {X. derivation X} is well-ordered.
Moreover, the set of derivable elements is closed under f . lemma derivable_closed: assumes "derivable x" shows "derivable (f x)" Proof. Let x ∈ X for a derivation X. It is easy to see that X↓x ∪ {x} is also a derivation, and that x is its maximum. It is easy to check that X↓x ∪ {x, f x} is also a derivation, and hence f x is derivable.
Finally, if the set of all derivable elements has a supremum, then it is a fixed point. In particular, since the set of derivable elements is well-related, well-completeness ensures the existence of the fixed point. Proof. Let D denote the set of derivable elements. Due to lemma derivable_closed, we have f`D ⊆ D. This means p is derivable via the limit case, i.e., p ∈ D, and thus f p ∈ D. Since p is a bound of D, we get f p p. On the other hand, by assumption derivation_infl we have p f p, concluding f p = p by antisymmetry.
3.2. Instances. We are left with the two assumptions derivation_infl and derivation_f_refl. One way to satisfy these assumptions is demanding them over the entire A instead of all derivations. We obtain the following generalization of the Bourbaki-Witt Theorem: theorem (in pseudo_ordered_set) well_complete_infl_imp_ex_fixed_point: assumes "well_complete A ( )" and "f`A ⊆ A" and "∀x ∈ A. ∀y ∈ A. x y −→ x f y" shows "∃p ∈ A. f p = p" Here we do not demand transitivity, but a variant of inflation "∀x ∈ A. ∀y ∈ A. x y −→ x f y" rather than "∀x ∈ A. x f x". Note that the two conditions coincide in posets. This result is also more general than Abian and Brown's version, since well-completeness and weak chain-completeness coincide in posets.
Another way to satisfy derivation_infl and derivation_f_refl is to assume that f is monotone, obtaining the existence part of Bhatta and George's fixed point theorem [4] without reflexivity. Indeed, these assumptions then become provable.
lemma mono_imp_derivation_infl: Proof. Fix a derivation X and y ∈ X. We prove the claim by induction on x, namely, assuming the following induction hypothesis: for all z ∈ X↓x, we prove that x y implies x f y. We proceed by case analysis on x ∈ X.
• Successor case: Suppose that the greatest element z in X↓x exists and x = f z. Since (X, ) is well-ordered, z, x, y ∈ X and z x y, we have z y. Then by monotonicity, x = f z f y. • Limit case: Suppose that X↓x is closed under f and x is its supremum. It is then enough to prove that f y is a bound of X↓x. So let z ∈ X↓x. We have z x y and as in the above case, z y. By IH, we get that z f y, and we conclude by extremality of x.
lemma mono_imp_derivation_f_refl: Proof. Let X be a derivation and x ∈ X. We know that (X, ) is well-ordered and thus reflexive. Consequently x x and we conclude f x f x by monotonicity. So we find a fixed point if f is monotone. Moreover, in this case we can further show that the fixed point is actually the least one.
lemma mono_imp_ex_least_fp: assumes "well_complete A ( )" and "monotone_on A ( ) ( ) f " shows "∃p. extreme {q ∈ A. f q = q} ( ) p" Proof. Due to well-completeness we obtain the supremum p of the derivable elements. We know that p is a fixed point by Lemma sup_derivable_fp. It remains to prove that p is the least one. For that, we prove that every fixed point q is a bound of the set of derivable elements. So let X be an arbitrary derivation. We show x q for every x ∈ X by induction on x. We proceed by case distinction on x ∈ X.
• Successor case: Suppose that X↓x has a greatest element z and x = f z. Since z ∈ X↓x, by the induction hypothesis we have z q. By monotonicity, we get x = f z f q = q. • Limit case: Suppose that X↓x is closed under f and x is its supremum. By induction hypothesis q is a bound of X↓x, and since x is least among such, we conclude x q.
To summarize this section, we proved the existence of fixed points for antisymmetric and well-complete relations. Inspired by Grall's proof we constructed a fixed point as the supremum of a well-related set defined using some derivation rules. This existence theorem has been instantiated to inflationary maps, leading to a generalization of the Bourbaki-Witt theorem without transitivity, as well as to monotone maps, leading to a generalization of the existence part of Bhatta-George's theorem, without reflexivity. In the latter, we also proved that the constructed fixed point is the least one.

Completeness of (Quasi-)Fixed Points
Until now, we focused on proving the existence of (quasi-)fixed points. However, fixed-point theorems for monotone maps are usually stronger: they state that the set of fixed points is complete itself. The objective of this section is to prove this statement with as few order-theoretic assumptions as possible. We will first take a step towards completeness by proving existence of least quasi-fixed points, again limiting the usage of ordering assumptions.
So how much can we generalize? We first expected that the set of fixed points of inflationary maps might have a least element. Nitpick [6] found a counterexample to this hope. Below we depict the relation and the mapping f below. Here, an arrow a i a j means a i a j and a i a j means f a i = a j .
In this example, indeed (A, ) is complete and f is inflationary. The (quasi-)fixed points are a 2 , a 3 , and a 4 ; however, none of them are least: a 2 and a 4 are incomparable, and a 3 is not below a 2 and a 4 .
So fixing our focus on monotone maps, we try to relax ordering assumptions. We first relaxed all ordering assumptions and asked Nitpick; it again found a counterexample for this claim.

Example 4.2 (by Nitpick). We stated (in related_set)
assumes "UNIV-complete A ( )" and "monotone_on A ( ) ( ) f " shows "∃p. extreme {p ∈ A. f p ∼ p} ( ) p" Below we depict a counterexample found by nitpick. Here, arrow a i ←→ a j means a i ∼ a j . In this example, indeed (A, ) is complete and f is monotone. The quasi-fixed points are a 1 , a 3 , and a 4 ; however, none of them are least, because a 1 a 1 , a 3 a 4 and a 4 a 4 .
After analysing the counterexample and existing proofs for partial orders and pseudoorders, we found a mild requirement on (A, ), that we call (semi)attractivity: locale attractive = semiattractive + assumes "semiattractive A ( )" The intuition of this assumption is depicted in Figure 3. Attractivity is so mild that it is implied by either of antisymmetry and transitivity: z y x x y z Figure 3. Attractivity: If two elements are similar, then arrows coming to one of them are also "attracted" to the other.
sublocale antisymmetric ⊆ attractive 4.1. Least Quasi-Fixed Points for Attractive Relations. We show now that a monotone map on a well-complete attractive set has a least quasi-fixed point. For later use, we further show that the quasi-fixed point is smaller than any strict fixed points; note that not all strict fixed points are quasi-fixed if we do not assume reflexivity.
Let us denote by ( s ) the extension of ( ) to sets.
definition "X s Y ≡ ∀x ∈ X. ∀y ∈ Y. x y" lemma attract_mono_imp_least_qfp: assumes "attractive A ( )" and "well_complete A ( )" and "monotone_on Proof. We reduce the claim to Lemma mono_imp_ex_least_fp. To this end, we first take the quotient of A with respect to (∼) to achieve antisymmetry. We define the equivalence class [x] ∼ for given x as follows: Note that we explicitly include {x} because we do not assume reflexivity, so not necessarily x ∼ x. Mathematically, [x] ∼ is the equivalence classe of x for the equivalence relation (∼) ∪ (=). This relation is trivially symmetric and reflexive, and it is transitive by the attractivity of ( ). We collect such equivalence classes into Q. Here, "{g x |. x ∈ A}" is our notation for the set {g x | x ∈ A}.
Let us say that x ∈ A represents [x] ∼ . The first observation is (1): We will apply Lemma mono_imp_ex_least_fp to the related set (Q, s ). To this end, we need (Q, s ) to be well-complete and antisymmetric. It is straightforward to see that (Q, s ) is antisymmetric using observations (1) and (2). To see that (Q, s ) is well-complete, let C ⊆ Q be well-related with respect to ( s ). It is easy to see that ( C, ) is also well-related. Since (A, ) is well-complete, C has a supremum x in A. We show that [x] ∼ ∈ Q is a supremum of C in (Q, s ).  (1) and (2), We are now able to apply Lemma mono_imp_ex_least_fp to (Q, s ) and F , and obtain a least fixed point P ∈ Q of F . We conclude by proving that any p ∈ P is a quasi-fixed point of f and that it is least among (quasi-)fixed points.
• p is a quasi-fixed point: Since p ∈ P , f p ∈ F P . Since P is a fixed point of F , P = F P and thus p ∈ F P . Consequently, f p ∼ p or f p = p. Since P is least, we have P s P , which implies that p p and that in any case f p ∼ p. • p is least: Let q be a (quasi-)fixed point, i.e., f q ∼ q or f q = q.  theorem attract_mono_imp_fp_qfp_complete: assumes "attractive A ( )" and "C-complete A ( )" and "∀X ⊆ A. well_related_set X ( ) −→ X ∈ C " and extend: " Proof. Denote the set {q ∈ A. f q ∼ q} ∪ P by Q. Given a subset X of Q in C, we prove that X has a supremum with respect to (Q, ). Define the set B of bounds of X.  • B is C-complete: Fix a subset Y of B in C. By the definition of B, every element in Y is a bound of X. Then by extend we know X ∪ Y ∈ C. By the C-completeness of A, X ∪ Y has a supremum s in A. We prove that s is a supremum of Y with respect to (B, ): s is a bound of Y by construction; s ∈ B since it is a bound of X by construction; s b for any bound b of Y in B, since b is a bound of X ∪ Y by the definition of B, and s is least among such bounds.
Consequently, by attract_mono_imp_least_qfp applied on (B, ), we find a quasi-fixed point q ∈ B which is least among quasi-and strict fixed points in B. By the definition of Q, q is also least in Q ∩ B. We conclude the proof by showing that q is a supremum of X with respect to (Q, ): • q ∈ Q: by construction.
• q is a bound of X: by construction, q ∈ B.
• q is least: let p be another element of Q which is also a bound of X. Then p is an element in B ∩ Q, and by the construction of q, q p.

4.3.
Instances. We instantiate the general lemma above with various classes as C, yielding generalizations of known fixed-point theorems from the literature. Note that the general lemma demands the following mild condition on C: Full Completeness: In this case we take C = UNIV. Then condition extend is trivially satisfied, and by taking P = ∅ we obtain: theorem (in attractive) mono_imp_qfp_complete: assumes "UNIV-complete A ( )" and "f`A ⊆ A" and "monotone_on A ( ) ( ) f " shows "UNIV-complete {p ∈ A. f p ∼ p} ( )" Moreover, when antisymmetry is assumed, attractivity is satisfied and quasi-fixed points are fixed points. Although fixed points may fail to be quasi-fixed without reflexivity, by taking P as the set of fixed points we obtain: theorem (in antisymmetric) mono_imp_fp_complete: assumes "UNIV-complete A ( )" and "f`A ⊆ A" and "monotone_on A ( ) ( ) f " shows "UNIV-complete {p ∈ A. f p = p} ( )" This result generalizes Stouti-Maaden and Knaster-Tarski theorems. In contrast to the former, we conclude the completeness of the set of fixed points, besides relaxing reflexivity. Compared to the Knaster-Tarski theorem, we have relaxed transitivity and reflexivity. Connex-Completeness: Consider now C = {X. connex X ( )}: It is also easy to see that connex sets satisfy extend, and we obtain completeness results for attractive sets and antisymmetric sets like in the full completeness case. We only present the statement for antisymmetry: theorem (in antisymmetric) mono_imp_fp_connex_complete: This generalizes Markowsky's result [20] by relaxing transitivity and reflexivity. Note that for posets, connex-completeness and chain-completeness are equivalent.
Pointed Directed Completeness: Pointed directed-complete asserts that every directed set, possibly empty, has a supremum. In this work, we say (X, ) is directed if any pair of two elements in X has a bound in X. For simplicity we allow the empty set to be directed, which is usually not the case in the literature.
definition "directed X ( ) ≡ ∀x ∈ X. ∀y ∈ X. ∃z ∈ X. x z ∧ y z" Observe that well-related sets are connex and thus directed. Finally, to show that directed sets satisfy extend (without reflexivity), we need a bit of argument.
lemma directed_extend: assumes "directed X ( )" and "directed Y ( )" and "X s Y " shows "directed (X ∪ Y ) ( )" Proof. For any x, y ∈ X ∪ Y , we find z ∈ X ∪ Y such that x z and y z. If either x, y ∈ X or x, y ∈ Y , then z is found immediately as X and Y are directed. So suppose x ∈ X and y ∈ Y ; the other case is symmetric. First, we obtain z ∈ Y such that y z; note that even though y y may fail to hold, we can find such z as an upper bound of {y, y}. Since x ∈ X and z ∈ Y , by assumption we conclude x z.
Hence now we can consider C = {X. directed X ( )}. Again we only present the completeness result for antisymmetry: theorem (in antisymmetric) mono_imp_fp_directed_complete: which generalizes Pataraia's result [23].
lemma well_related_extend: assumes "well_related_set X ( )" and "well_related_set Y ( )" and "X s Y " shows "well_related_set (X ∪ Y ) ( )" Proof. Let Z ⊆ X ∪ Y with Z = {}. We prove that Z has a least element z. We consider the following two cases: • If Z ∩ X = {}, then Z ⊆ Y and Z has a least element z since Y is well-related.
we conclude f n+1 ⊥ f p. To this end we need f n ⊥ f n ⊥ for every n, which would be trivial if we had reflexivity. Instead we prove this fact by induction on n, also using omega_continous_imp_mono_refl.
Now the first part of Mashburn's theorem is reproved without any order assumption: for an ω-complete set (A, ) with a bottom element ⊥ and ω-continuous map f : A → A, there exists a supremum for {f n ⊥ | n ∈ N} and it is a quasi-fixed point.

5.3.
Iterative Fixed Points are Least. Though we proved the existence of a quasi-fixed point, Kleene's and Mashburn's fixed point theorems moreover claim that the fixed point is exactly the least one (in posets). Hence naturally we considered proving this claim for arbitrary relations, but again Nitpick saved us this hopeless effort.
Example 5.1 (by Nitpick). Our conjecture now assumes "extreme_bound ( ) Fn q" and shows "extreme ( ) {s. f s ∼ s} q". Following we depict a counterexample found by nitpick: In this example, indeed a 1 is a bottom element, is (ω-)complete, and f is ω-continuous. The set of quasi-fixed points is {a 1 , a 2 , a 3 }, and a 3 is a supremum of {f n ⊥ | n ∈ N} = {a 1 , a 3 }. However, a 3 is not a least quasi-fixed point because a 3 a 2 . Now again, attractivity turns out to be the key.
theorem(in attractive) kleene_qfp_is_dual_extreme: assumes "omega_complete A ( )" and "omega_continuous A ( ) f " and "⊥ ∈ A" and "∀x ∈ A. ⊥ x" shows "extreme_bound A ( ) {f n ⊥ |. n :: nat} = extreme {s ∈ A. f s ∼ s} ( )" Proof. Let q be a supremum of Fn. By kleene_qfp, we already know that this is a quasi-fixed point. So to prove that q is a least quasi-fixed point, it is enough to show that any other quasi-fixed point s is a bound of Fn = {f n ⊥ | n ∈ N}. This is done by induction on n. The base case ⊥ s is trivial by assumption. For the inductive case, assuming f n ⊥ s we get f n+1 ⊥ f s by the same argument as in the previous proof. Since f s ∼ s, attractivity concludes f n+1 ⊥ s.
Conversely, consider a least quasi-fixed point s. We show that s is a supremum of Fn. Since s is a quasi-fixed point, and as we have just proved above, s is a bound of Fn. It remains to prove that s is least in bounds of Fn.
By ex_kleene_qfp, Fn has a supremum k, and k is a quasi-fixed point. As s is a least quasi-fixed point, we have s k. On the other hand, as s is a bound of Fn and k is a least of such, we see k s. Consequently, s ∼ k.
Now let x be a bound of Fn. We know k x, and with s ∼ k, we conclude s x due to attractivity.

Conclusion
In this paper, we developed an Isabelle/HOL formalization for order-theoretic fixed-point theorems. We adopt an as-general-as-possible approach, so that many results previously known only for partial orders or pseudo-orders are generalized to attractive or antisymmetric relations. In particular, the proof of existence of a fixed point using a proof-tree-like method, as well as the general method to prove the completeness of the set of (quasi-)fixed points, allowed us to recover and generalize many known fixed-point theorems from the literature. These achievements become reachable to us largely due to the great assistance by the smart Isabelle 2020 environment. For future work, it is tempting to further formalize and hopefully generalize other results about completeness and fixed points. For example, we are considering some results proved in [20], such as the equivalence of chain and pointed directed completeness, and the converse of Markowsky's fixed-point theorem, both requiring some form of axiom of choice. We also plan to extend the library with convergence arguments and to apply this general theory of fixed points to a domain like term rewriting, which was actually our original motivations for formalizing these order-theoretic concepts.