Constructive Substitutes for Kőnig’s Lemma
Abstract
We propose weaker but constructively provable variants of the contrapositive of Kőnig’s lemma. We derive those from a generalization of the FAN theorem for inductive bars to inductive covers, for which we give a concise proof. We compare the positive, negative and sequential characterizations of covers and bars in classical and constructive contexts, giving precise accounts of the role played by the axioms of excluded middle and dependent choice. As an application, we discuss some examples where the use of Kőnig’s lemma can be replaced by one of our weaker variants to obtain fully constructive accounts of results or proofs that could otherwise appear as inherently classical.
Keywords and phrases:
Kőnig’s lemma, FAN theorem, constructive mathematics, inductive covers, inductive bars, almost full relations, inductive type theory, CoqFunding:
Dominique Larchey-Wendling: partially supported by NARCO (ANR-21-CE48-0011).Copyright and License:
2012 ACM Subject Classification:
Theory of computation Type theory ; Theory of computation Constructive mathematicsSupplementary Material:
Software: https://github.com/DmxLarchey/Constructive-Konig [19]archived at
swh:1:dir:611c848b0dbc19c9de20744122776440c00e413d
Editors:
Rasmus Ejlers Møgelberg and Benno van den BergSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Kőnig’s (infinity) lemma, named after Dénes Kőnig, was originally published as a theorem of graph theory [18]. Nowadays, it is usually conflated with the following statement:
Any infinite tree which is finitely branching has an infinite branch.111the original statement rather talks about paths in a graph.
The restriction to at most binary trees is of particular importance because it can be stated within lightweight foundations like e.g. [26], and is usually called weak Kőnig’s lemma (). Notice that Kőnig’s lemma is also used in its contrapositive form:
Any finitely branching tree with only finite branches must be finite.
Classical mathematicians would not mind switching between the two formulations but herein, we refrain from using excluded middle at will, and we adopt a constructivist point of view. In this context, that contrapositive form is sometimes referred to as “Brouwer’s FAN theorem” [5, p. 13]. Although there is no universal agreement on what constitutes constructive mathematics, we use the inductive type theory that is the basis of Coq, free of additional axioms, as our constructive foundations.
Kőnig’s lemma plays critical roles in various fields of mathematics like logic, computability, tiling theory, etc. and has been investigated by reverse mathematics, e.g. as in [26], and constructive reverse mathematics [2, 3]. Although some of our investigations might be relevant to the program of reverse mathematicians, we do not follow that approach. We favor a more pragmatic perspective: since the lemma does not belong to the realm of purely constructive mathematics, can we propose weaker alternatives that could be used, not as drop-in, but rather as low cost replacements for Kőnig’s lemma? Of course, we require that those alternatives are constructively provable.
Kőnig’s lemma can (in particular) be used to establish the termination of algorithms, and typically has been used for the decision procedure of implicational relevance logic [8, 17]. It is instrumental to show the existence of Harvey Friedman’s [11] monster (extremely fast growing) function, in combination with Kruskal’s tree theorem, see e.g. [13] where both proofs rely on classical mathematics. These are two example applications of our tools aimed at giving constructive accounts of what could otherwise look inherently classical.
As simple as it sounds, Kőnig’s lemma involves the notion of infinite tree. Hence, the trees cannot simply be understood as the inductively defined structure to be found in computer science (these are always finite). Also, the notion of infinite is not as straightforward in the constructive world. In reverse mathematics, where the usage of versatile data structures may be constrained, a tree is often conflated with its set of finite branches (so finite sequences of nodes where the next node is a son of the current node). As such, trees are nonempty, prefix closed, sets of finite sequences, possibly with a computable membership predicate. And infinite branches are sequences for which every finite prefix belongs to the tree, i.e. the upper limit of a growing sequence of finite branches of the tree.
In that context, one can prove Kőnig’s lemma using excluded middle and a weak form of the axiom of choice (e.g. dependent choice). If a canonical choice can be made over the sons, typically when there is a total order that can sort the sons at every node of the tree, the infinite construction process in the proof can be determinized (by choosing the least son) and the reliance on the axiom of choice is avoidable in that case. However, excluded middle is more critical, in particular to show that when the union of finitely many sub-trees is infinite, it must be because one of them is infinite. “Being infinite” is not a decidable property so the selection performed by excluded middle cannot be turned into a computable value.
Kleene [16] famously gave a counterexample to a computational interpretation of weak Kőnig’s lemma: he builds a computable infinite binary tree, so a decidable set of finite sequences of Booleans,222choices between the left or the right son. for which there exists no computable infinite branch, i.e. no infinite sequence of Booleans of which every finite prefix belongs to the tree. This gives a very strong argument against the constructive acceptability of Kőnig’s lemma, at least when one “interprets Bishop’s mathematics in a recursive way” [6].333as said earlier, the notion of what is constructively acceptable is not universally agreed on.
Not only Kőnig’s lemma could be rejected from a constructivist point of view, but some of its consequences suffer similar defects. Consider the compactness result for Wang tilings:
A finite set of tiles can tile the plane if and only if it can tile any finite square.
Similarly to Kleene’s result, Hanf [14] and Myers [24] famously gave examples of finite sets of tiles that can tile the whole plane, but only in a nonrecursive way. This invalidates a computational understanding of the compactness result. Hence no constructive account of the proof of the compactness result can be given, otherwise it would entail the existence of a recursive tiling.444Notice that the tileability of a finite square is a decidable property.
So there is no real hope at a drop-in constructive replacement for Kőnig’s lemma because some of its consequences might live outside the realm of constructive or computable mathematics. Nevertheless, we argue that it might be used in contexts where weaker alternatives would also fit. And it is our aim here to explore some of those alternatives.
For instance, there is an interpretation of its contrapositive form, i.e. “any finitely branching tree with only finite branches must be finite,” where the notion of infinity is replaced by finitary notions. Notice that the referred statement still relies on arbitrary (finite or infinite) trees: when saying “only finite branches,” one must consider the possibility that it contains infinite branches otherwise this hypothesis is vacuous:
-
one classical way to understand “only finite branches” is by saying that no infinite sequence can have all its finite prefixes in the tree. Hence even though the statement does not refer to infinity, it is uncovered in this unfolding;
-
another way is to understand “only finite branches” is to give an inductive characterization of the well-foundedness of branches with the single rule for the predicate:
where is a parameter relation. Intuitively, means that is the father of in the tree (or is a son of ). If nodes are conflated with finite branches, then means that has the shape , i.e. followed by a single choice of a son.
In that later case, finiteness of the tree branching along and rooted at can be defined by , and thus understood as the unavoidable termination of the nondeterministic process of expending branches by adding sons after sons, starting from the . Intuitively, the proof of is a well-founded tree where a leaf is decorated with a proof of such that is childless (i.e. ). In that inductive understanding of “only finite branches,” the contrapositive of Kőnig’s lemma can be established by well founded induction, see e.g. [1, p. 15]. We will derive it as a corollary in Section 5.3.
In intuitionistic frameworks, Brouwer’s FAN theorem is a consequence of the Bar theorem, originally designed to grasp the full continuum in an approach to real analysis [5]. Its acceptability from a constructive standpoint is a delicate issue. It has a rich track record: see e.g. Troelstra [27, 28] for the context of intuitionistic analysis, but there are more recent results, related to convexity [4] or to the exhaustibility of the Cantor space [9]. Intuitionists have compared Kőnig’s lemma with the FAN theorem in various contexts, e.g. [12, 30].
Remember that our aim is not to study the FAN theorem per se, but to propose workable alternatives to the use of Kőnig’s lemma for the conversion of classical proofs to constructive ones. In this context, we may abuse referring to Kőnig’s lemma even though, from a purely intuitionistic standpoint, the results we discuss are closer to the FAN theorem.
However, in contrast with the above cited work on the FAN theorem, we differ in our approach to quantification over the branches of trees. We follow Coquand’s thesis [6] that bar inductive predicates are the correct expression of universal quantification over choice sequences, be they lawlike or lawless; see our discussion in Section 3.5. Hence, we work directly with inductive bars (on finite sequences), avoiding Brouwer’s thesis [29] completely. Actually, we use the more general notion of inductive cover [25] on (transition) relations.
As for our contributions, in Section 3 we show that the notion of inductive cover generalizes both inductive bars and (inductive) accessibility, w.r.t. its definition as well as w.r.t. the results that it entails. We then give a detailed comparison between the constructive and classical strength of three characterizations of covers: positive, negative and sequential. In particular, for the classical part of the comparison, we separate the role played by excluded middle and dependent choice and show the key role played by the intermediate negative characterization. It will also play an important role in a constructive context, as a substitute to the sequential characterization, when used in combination with the FAN theorem.
In Section 4, we give a type theoretic interpretation of the FAN theorem for inductive covers, with a concise proof. The central argument, the stability of upward closed inductive covers under binary union, differs from that of the proof of Fridlender’s FAN theorem for inductive bars [10] which relies on the stability of monotone inductive bars under binary intersection. However, we derive the FAN for bars as an instance of the FAN for covers, to make the generalization explicit.
In Section 5, we exploit the FAN for inductive covers, followed by an application of the negative characterization of covers, to give several weaker versions of (the contrapositive of) Kőnig’s lemma, showing how relations can be represented by rose trees (hence finitary). This includes an extra covering assumption, or an extra bar assumption, or else an extra almost fullness assumption.
In Section 6, we give two examples where Kőnig’s lemma can successfully be replaced with one of these weaker variants to give constructive accounts of results of which the former proofs were using the classical form of the lemma.
Additionally, we contribute a mechanization of all the results of the paper in a Coq script that can of course be type checked for correctness, but was especially designed to be read by humans, not only by computers. The script is mostly self contained, largely commented, with concise proofs: the longest is 25 loc but most of them are shorter than 10 loc. It is accessible under a free software license at
2 Coq preliminaries
We denote by the type of propositions and simply by the Coq hierarchy of types, as usual with this framework. We write for the empty proposition and use the standard notations for logical connectives. Recall that the logic of Coq is intuitionistic hence the negation is defined by . Following the BHK interpretation, more generally denotes the type of maps from to , and we write for the dependent product, irrelevant of whether or . Whenever it can be guessed, the type annotation in is simply avoided. The dependent sum has several flavors in Coq: for we have the proposition and the type which behave somewhat similarly but are however fundamentally different because propositions of sort cannot systematically be eliminated to build terms of sort .
The type of Peano natural numbers is inductively defined in Coq as and arithmetic in Coq, which we assume, is built on this type. We manipulate finite sequences as lists, polymorphic555operators on lists are parametric in and this first argument is nearly always left implicit. over the carrier type , in the inductive type where . Additionally, list concatenation (resp. membership) is named (resp. ), denoted infix by (resp. ), and defined by a guarded fixpoint. Moreover, we use the reverse and the length functions as well as the permutation relation , as inductively defined in the module of the Coq standard library.
We define finiteness as a property of unary relations (viewed as sets):666Like lists based results, is parametric in and the braces around it specify an implicit argument.
i.e. there exists a list spanning the relation . This characterization of finiteness as listability is equivalent to Kuratowski finiteness but easier to manipulate formally.
We manipulate relations as functions outputting propositions, hence we denote by the type of heterogeneous binary relations between and . In the homogeneous case, we simply write , and in the unary case. We use the letters to denote unary relations and to denote binary relations. We write or for the inclusion between relations. Except for commonly found notations like , or , we generally write related pairs with e.g. a letter for the relation name, in prefix order, like in .
For complex inductive predicates, we rather present the constructors using rules with a horizontal line separating the premises from the conclusion. As an example, we below display those of (denoted ) and (denoted ) which are finitary conjunctions defined in the module of the standard library, for and :
The free symbols and can be instantiated by any value in their respective types. In the corresponding Coq constructors, they are universally quantified over.
3 Inductive covers
We recall the notion of inductive cover [25] which subsumes both accessibility and bar inductive predicates; see Sections 3.2 and 3.3. We discuss three characterizations of covers, the positive, the negative and the sequential, from the strongest to the weakest (constructively), but also explain in some details how to get their classical equivalence, separating the roles played by the axioms of excluded middle and dependent choice. We discuss these characterizations in the context Brouwer’s intuitionistic understanding of infinite sequences.
Before we switch to covers, we import the standard order theoretic notion of being upward closed, however not requiring partial orders but any binary relation instead.
Definition 1 (Upward closed).
Given a type and a binary relation , we say that a unary relation is -upward closed if is stable under direct -images. We define: .
For instance, the finitary conjunction is upward closed for permutations, formally stated as . Upward closed unary relations will be preserved by covers, and some results about covers (including the FAN theorem) assume upward closed relations.
3.1 Inductive covers definition, basic results
As in [25], we work with the class of singleton inductively generated formal topologies, as opposed to the more general (e.g. indexed) presentation of [7]. They are defined by the notion of inductive cover of a set (i.e. unary relation) along a (transition) binary relation.
Definition 2 (Inductive cover [25]).
Given a type , a binary relation and a unary relation , we define the inductive -cover of , denoted by the two following inductive rules:
Notice that (resp. and ) is denoted by (resp. and ) in [25] but we favor prefix notations. Remark that the transition relation is hidden in the infix notation used for the cover whereas we keep it in . Also in [25], the constructor (resp. ) is called reflexivity (resp. infinity).
The non-dependent induction principle (or eliminator, depending on your preferred terminology) generated for the predicate has the following type:
Informally, it states that is included in any unary relation closed under the constructors/rules and . Coq auto-generates a slight variant777namely of type . of but they are equivalent as non-dependent eliminators. We choose to present the above one because of its direct link with the positive, negative and sequential characterizations of the cover that we discuss in Section 3.4. In our Coq code, we give a straightforward implementation of as a guarded , similar to the auto-generated one.
Using the induction principle in combination with the constructors, we show how a morphism can be used to transfer covers between different types and relations.
Proposition 3 ().
Let be two types, and be binary relations, and and be unary relations. We further assume a map which is supposed to be a morphism w.r.t. and , i.e. satisfying
Then we have .
As they are made available as Coq code, we generally do not give detailed proofs herein. To illustrate how we reason by induction using , we exceptionally give a detailed account of the proof for the statement.
Proof.
We first reorder the hypotheses and the goal becomes , which we prove by induction on : we factor out in the goal as with . Reasoning backwards, we apply the instance to the goal, replacing it with two sub-goals:888factoring out and applying are automated for us by the Coq tactic.
-
: unfolding , we assume s.t. and s.t. and we have to show . We derive by substitution and then using the left morphism hypothesis. We then derive using the constructor ;
-
: we assume s.t. (corresponding to the induction hypothesis) and s.t. , and we have to show . We substitute with in and get . Applying the second constructor , we replace the goal with . Hence we assume s.t. and we now have to show . Using the right morphism hypothesis, we derive . We instantiate the induction hypothesis as and get as desired. Notice that we use the reflexive identity for .
This concludes the proof. Using standard automation for backward proof-search (the tactic), the Coq proof script however consists in only two lines of code, one for reordering the hypotheses in the initial statement, the second telling which hypothesis to perform induction on, and then launching automation after substituting for .
For the rest of the section, we assume a fixed type to be used as carrier for binary relations and unary relations . The monotonicity of can be obtained as a particular case, using the identity morphism . More precisely, is antitonic in its first argument and monotonic in its second argument:
Additionally to be increasing (by ) and monotonic (by ), is also an idempotent operator making it a closure operator:
Proof.
Assuming an arbitrary , the proof of proceeds by induction on . Then we get that the operator preserves -upward closed unary relations:
Proof.
We assume and an arbitrary and show by induction on .
3.2 Inductive cover and accessibility
In this section, we fix a type to serve as carrier for relations below. We recall that the predicate is a generalization of the accessibility predicate, also called -founded in [25].
Definition 4 ((essibility), -founded).
Given a binary relation , the (essibility) predicate999The variant as defined in the Coq standard library module , simply uses the reversed relation instead of for . So we have and . for and the -founded predicate101010-founded is defined in [25, Definition 3.1]. are defined inductively, each with one single rule:
A simple observation shows that the shape of the constructor is the same as the second constructor of the predicate. Furthermore, the first constructor can be neutralized by setting as the empty relation . Hence we immediately derive the equivalence:
Proposition 5.
The (essibility) predicate is an instance of the predicate.
Moreover, accessible elements are necessarily irreflexive. Indeed, we show by induction on . Hence it follows that the left premise of the constructor of -founded is superfluous:
Proposition 6.
-founded and accessibility define equivalent notions:
As a corollary we get , a result already established in [25, Theorem 3.2] but, seemingly, the authors did not observe that the left premise ( i.e. irreflexivity) of the introduction rule for -founded was superfluous.
3.3 Inductive cover and inductive bars
Let be a carrier type for lists. We consider unary relations on the type that we use to represent finite sequences. We show that inductive covers, in addition to generalizing accessibility predicates (see Section 3.2), also generalize inductive bar predicates [6, 10].
Definition 7 (Inductive bar).
Let be a unary relation on lists. We define the inductive unary relation with the two following inductive rules:
Compared to [10, Definition 6], there are two slight differences. First our lists expand from the left, whereas often in the literature [6, 10, 29], finite sequences expand from the right. Hence rule would be written
with such a reversed convention. However, this difference can be viewed as just of matter of ordering the display of the arguments of the list constructor . Another more important difference compared to [10, Definition 6] or else [29], is the absence of the inductive rule
in Definition 7. We discard rule because it is admissible for monotone unary relations on finite sequences.
Definition 8 (Monotone unary relation).
A unary relation is monotone if it satisfies .
The (discarded) rule/constructor would ensure that is a monotone predicate even when is not monotone. However, as an instance of , if is monotone then so is ; see after Proposition 10 below. We observe that monotone unary relations are those which are upward closed under list extension:
Definition 9 (list extension).
The binary relation on lists is defined by the single inductive rule:
We could have used the first order characterization to give an alternate definition of . With this notion, we get the equivalence
as an immediate consequence, but the specialization goes further:
Proposition 10 ().
Given a unary relation and a list , we have the equivalence .
Thanks to Proposition 10 and , the two below results are specializations of respectively and .
More generally, the analysis that we are going to present for inductive covers in the next section can be specialized to either accessibility predicates and inductive bar predicates.
3.4 Positive, negative and sequential characterizations
We now discuss other characterizations of covers, which are not constructively equivalent to the inductive one, but however are classically equivalent, hence the abusive use of the word “characterization.” We present a detailed analysis of those characterizations and which classical axioms their equivalence depends on.
The results of this section that assume classical axioms are not used elsewhere in this paper: these axioms are (propositional) excluded middle (XM), giving us De Morgan laws for logical connectives and quantifiers, and dependent choice (DC):
The names of the results that depend on these added axioms are suffixed with or or both for an unambiguous exposition.
We start with the following definitions of the positive characterization , the negative characterization , and the sequential characterization .
Definition 11 (Nonequivalent characterizations of cover).
Although not equivalent, the constructive strength of these characterizations can be compared: they are displayed from the strongest () to the weakest (). Beware that both and are universally quantified over in the characterizations below.
The positive characterization is really just a reordering of the implications in the induction principle , so we get the following equivalence purely constructively:
The positive characterization is constructively stronger that the negative one:
Proof.
We use as the formulation of an induction principle. The negative characterization is constructively stronger than the sequential one. The below proof argument anticipates the intuition behind the definition of the negative characterization.
Proof.
Assuming a -sequence , we instantiate with the direct image . We show and conclude.
We now explain the intuition behind those definitions by turning to a classical interpretation where all those characterizations are equivalent, discussing the precise roles played by XM and DC. The negative characterization is central to our analysis and can be understood in two ways, either as deriving from or generalizing :
-
The first understanding of is as contrapositive form of :
The proof involves excluded middle but first-order De Morgan transformations are enough to get the equivalence.111111In the Coq script, we insist on obtaining that equivalence via De Morgan rewriting and congruence only. The converse implication of above is unlikely to be constructively provable (see Section 3.5), but it is a direct corollary to ,121212see . however assuming XM as an added axiom;
-
The second way to understand the negative characterization is to view it as a generalization of the sequential characterization . Notice that the statement is the usual intuitive definition of being a -cover for :
Any infinite -sequence starting at meets .131313Such formulation are more commonly found for the “intuitive” (read sequential) definition of “being a bar for ” [6]. See in Section 3.5 for the corresponding specialization.
However this interpretation depends on what are the inhabitants of the type of which is a member; see Section 3.5. In the proof of , we used the direct image as a particular instance of in . represents a set of values containing and over which is a total binary relation, which generalizes -sequences by removing the requirement of determinism. The quantification over -sequences is replaced by quantification over which is an -unstoppable nondeterministic process: indeed any point in has at least one -image in . This property of unstoppability is shared also by Brouwer’s notion of spread.
As a consequence of the above discussion, constructively already, the positive characterization is equivalent to the inductive one, and stronger than the negative one, which is itself stronger than the sequential one. Hence we derive:
If one is interested in the converse implications, then, on the one hand, XM would be used to prove that implies . On the other hand, to recover from , one uses which is dependent choice specialized on the -type where . Indeed, the statement of , i.e. dependent choice specialized on type is:
When , we reformulate the instance as141414see in the Coq code.
which is exactly what is needed to extract a sequence out of the -unstoppable process starting at .
Theorem 12 (in the spirit of Brouwer’s bar theorem).
Assuming and , the inductive and the sequential characterizations of covering are equivalent:
Hence under XM+DC, any cover is an inductive cover while Brouwer’s “bar theorem” states that “any bar is inductive bar,” or, quoting [6], for sequences of natural numbers:
The bar theorem statement is an instance of Theorem 12 where . Indeed, an -sequence of lists in corresponds to the -prefixes of a sequence ; see in the Coq code.
3.5 Discussion
We have explained how the inductive predicates and are just specializations of the notion of inductive so the remarks below also apply to those restricted notions. For instance we get the following specializations for and :
The negative characterization is intermediate between the inductive/positive characterization (strongest) and the sequential characterization (weakest). We isolate the role played by XM (in fact De Morgan laws) and DC. While it avoids DC, the negative characterization, using unstoppable nondeterministic processes instead of sequences, still likely requires XM to be equivalent with the positive characterization. Indeed, were the negative characterization be constructively equivalent to positive/inductive characterization, such a result would instantly give us Theorem 12 (and Brouwer’s bar theorem) using DC alone, hence avoiding XM.
The discussion on what is nature of (infinite) sequences is central to the sequential characterization of bars, and of course, as the infinite itself, is very much debated in constructive mathematics. Clearly, adjoining XM and DC populates the type with enough lawless sequences. Brouwer however rejected XM and DC and instead justifies his bar theorem using “Brouwer’s thesis” [29] which is not as strong as an axiom as XM+DC. In [6], Coquand criticizes the use of the type to cover “all” sequences in the sequential characterization of bars:
“This example is paradigmatic: by replacing systematically the intuitive notion of bar by the notion of inductive bar, we can now prove Brouwer’s fan theorem. More generally, we can think of as the correct format expression of a universal quantification over all sequences, not necessarily given by a law.” (emphasis added)
To be more specific, absent of extra axioms, the type of lawlike sequence (on which the sequential characterization is based) cannot account for sequences that do not evolve according to a predetermined law, see e.g. Veldman [29]:
“the intuitionistic mathematician […] admits the possibility of sequences that are created step-by-step and thus, in some sense, are given by a black box. He is very much aware that he is unable to make any kind of survey of the totality of all infinite sequences of natural numbers.” (emphasis added)
In a way, we follow and extend to covers the program proposed by Coquand [6] to systematically replace the intuitive (understand sequential) notion of cover by the inductive version, avoiding axioms altogether. But we can still use the sequential or negative versions, in a limited way, at the end of a constructive deduction, e.g. following the FAN theorem.
4 The FAN theorem for inductive covers
In this section, we present another interpretation of the FAN theorem in type theory, generalizing the FAN theorem for inductive bars [10] to inductive covers [7, 25] instead. We give a concise proof for this result, which differs significantly from that of [10, Theorem 6]. Hence, as an specialization, we get an alternate proof of that former result as well.
In this section, let us fix a type and a binary relation . We extend the binary relation to lists (viewed as finite sets), as using the direct image and this way, we can view FANs over as -sequences over finite sets.
4.1 Lifting a relation to finite sets
We define the finitary image relation on viewed as finite sets, i.e. permutations and contractions are admissible for lists used in that context.
Definition 13 (Finitary image).
We define the finitary image binary relation on lists, denoted , by , i.e. holds when is included in the direct image of .
The finitary image relation is monotonic in its first argument and antitonic in its second argument, i.e. holds.
One critical observation for the proof of the FAN theorem below is how behaves when splitting its first/source argument in two halves. Then there is a corresponding splitting of the second/image argument, but since ignores the order on the elements of lists, this splitting only holds up to a permutation of the image list:
which we show by induction on . Additionally, we show that is upward closed for permutations for any , which can be written as . And to conclude this section, if is upward closed for then the finitary conjunction of (over lists) is upward closed for , i.e. .
4.2 Proof of the FAN theorem for inductive covers
We give a proof of the statement of the FAN theorem for inductive covers, using the finitary image relation to represent FANs over the relation .
Theorem 14 (FAN for inductive covers).
Let be -upward closed. If is in the -cover of then the singleton list is in the -cover of , i.e.
Using a sequential understanding of covers, the statement could be read as: if any -sequence starting at meets then any -sequence starting at meets , hence “any finitary FAN rooted at meets a monotone uniformly,” which is a commonly found informal statement of the FAN theorem.
While this sequential understanding cannot be established in our constructive framework (for reasons discussed in Section 3.5), we below give a quite compact inductive proof of the positive/inductive understanding of the statement of the FAN theorem for inductive covers.
Proof.
Let us assume with . We first show that is upward closed for permutations, stated as . For this, we prove by induction on .
Now, we establish the key result that is stable under (binary) union, herein represented by the append operation on lists:
The proof proceeds by nested induction, first on and then on , with a critical use of to invert two statements of shape where the first argument of is a union of lists. As a corollary of , we get the specialization where is a singleton as
and then, as a direct consequence
for which we proceed by induction on .
We can conclude with the proof of the FAN theorem for inductive covers. We establish , reasoning by induction on :
-
the base case where holds is trivially solved by giving a proof of and then deriving with an instance of first constructor ;
-
in the recursive case where is the induction hypothesis, we show and then combine this with and an instance of the second constructor .
This concludes our proof of the FAN theorem for inductive covers.
We can immediately derive by induction on and then the following characterization of covering for the finitary image:
i.e. the list is -covered for if and only if all the members of are -covered for .
4.3 The FAN theorem for inductive bars
We recall the interpretation of the FAN theorem in type theory [10] and derive an alternate proof of that result as an instance of Theorem 14, which illustrates our claim of generalization. We fix a carrier type for lists and consider relations over and . For , let us first define the
i.e. if written as and , means and . Stated in plain english, is a list of one-to-one choices for the choice list ; see the inductive definition of in Section 2. Using generic tools designed for the abstraction, we can show that is a finite, i.e.
However in [10, page 102], the author gives a specific construction of a list which collects the lists of choices s.t. , that we denote herein, satisfying:
Thus the dependent pair is an (explicitly given) proof of the proposition . The value of can be viewed as a generalization of the exponential function to lists, computing the list of choice sequences for .
The FAN theorem as stated and proved in [10] relies on the particular implementation of the exponential given there, but the result itself only depends on the fact that satisfies . Theorem 6 of [10] also assumes the added rule in the inductive definition of the predicate but it is admissible for monotone relations.
Theorem 15 (reminder of Theorem 6 of [10]).
Let be unary relation. The following statement holds: .
Proof.
We first reformulate the result as
which is an equivalent statement thanks to the monotonicity of the predicate. Indeed, using , we get the equivalence for any . Now the statement is independent of the implementation of .
Using the results of Section 3.3, we replace the hypotheses and by and , and the goal becomes . Hence, by Theorem 14 we get . Then we transfer the inductive cover using as a morphism (Proposition 3):
after having checked that the following statements hold: , and .
Theorem 6 of [10] (cf. Theorem 15), and its original proof, even though it uses one particular implementation of both in the proved statement and inside the arguments, can be adapted to work for any implementation of as soon as it satisfies . The reason is that we pass through which is independent of the actual implementation of . This is how the proof is implemented our Coq code.
Besides the previous remark and the detour via inductive covers, the proof we give differs from that of [10] in an important way. Indeed, the core argument of the later proof is the closure of monotone inductive s under binary intersection [10, Proposition 3]:
which is there established by nested inductions on , and then on . On the contrary, the core argument in the proof of Theorem 14 lies in , i.e. the closure of under binary union (the append operator on lists). In a way, it generalizes to upward closed inductive covers the stability under binary unions of finiteness.
5 Weaker variants of the contrapositive of Kőnig’s lemma
Recall the contrapositive form of Kőnig’s lemma: any finitely branching tree without infinite branches is finite. We introduce (inductive) rose trees, i.e. finite trees with arbitrary (finite) branching at each node, and we give a type theoretic variant which has stronger assumptions (e.g. the covering assumption below), and which replaces the notion of possibly infinite tree that is implicit in formulation “any … tree without infinite branches” with that of a relation:
Assume a finitely branching relation and which is -upward closed. If belongs to the -cover of then the finite paths along starting at and avoiding are the branches of a rose tree rooted at .
Notice that we use equivalence between paths and branches to express that (part of) a relation is “the same” as a rose tree. Because we only view the relation via its paths, the acyclicity assumption, as used when (infinite) trees are viewed as graphs, can be dropped. But before we formalize this statement, we must define paths, rose trees and their branches.
5.1 Path, rose trees and their branches
Let us fix a type as carrier for relations and indices of rose trees below.
Definition 16 (Inductive path).
For a relation , the paths in are described by a ternary relation defined by two inductive rules:
Intuitively, means that is the sequence of values encountered on a path from to , following the relation , including the endpoint but excluding starting point . The existence of a -path from to is equivalent to the reflexive-transitive closure of (we do not use this characterization however), and hence we have:
Definition 17 (Inductive rose tree).
The type of -indexed rose trees denoted is inductively defined by a single rule:
where we denote as a shortcut for . The root of is indexed by and we write , and is the list of the sons of . We define the height of a rose tree, denoted , using the fixpoint equation .
The branches of a rose tree (the paths starting at the root) are characterized using a ternary relation inductively defined by two rules:
Hence a branch is either empty, stopping at the root, or the choice of a son (i.e. sub-tree) and of a branch in that son. The predicate relates a tree , a list of visited indices up to the index of the root of a sub-tree of .
5.2 Representing binary relations using rose trees
We give a formal definition for the statement “a binary relation is a finite tree.” This is required indeed because the type of binary relations and the type of rose trees are very different. We use paths in relations and branches in rose trees as a means to define the notion of representation by a rose tree, for the part of a relation rooted at of which the paths from satisfy the property .
Definition 18 (Representation).
Assume a binary relation , a property for paths and a point . We say that in at is strongly represented by and write if:
We say that in at is represented by and write if:
The property for paths is applied only to those originating at but can depend on the destination as well as on the sequence of visited nodes on the path to the destination.
We observe that . While the strong notion would be a first/natural choice to formalize the idea that the relation starting at and restricted by “is a tree,” this choice can however be questioned in the light of decidability issues. Indeed, when is equipped with a (propositionally) decidable equality,151515i.e. . e.g. when , then both and become decidable predicates. In that case, implies that is decidable as well, an assumption we want to avoid for building representations. In the case of , does not need to be decidable but the representing tree may contain branches which do not satisfy .
We assume a fixed which is furthermore finitely branching, i.e. . We show that paths of bounded length can be strongly represented.
Theorem 19.
When is finitely branching, for any and any , the property in at has a strong representation.
Proof.
We build the tree t s.t. by induction on , after generalizing on .
Now we characterize the properties of paths that have representations as those which hold only for small paths.
Theorem 20.
When is finitely branching, for any property and any point , the two following statements are equivalent:
-
;
-
.
Proof.
In the forward direction, the bound can be chosen to be the height of the representation of in at . In the reverse direction, given a bound for the length of paths satisfying , we first obtain a tree s.t. . We then check that this tree represents in at .
Theorem 20 states that, in the finitely branching case, a relation is represented by a (finite) rose tree if and only if there is a global bound on the length of its paths. In the context of the FAN theorem (the contrapositive of Kőnig’s lemma), it relates the finiteness of a tree to the boundedness of its height, the length of its longest branch. It can be compared to the characterization of binary trees161616as sets of finite sequences of Booleans representing their finite branches. which are finite as those for which there is a uniform bound on the length of their branches, see e.g. [15].
5.3 Kőnig’s lemma for inductive covers, accessibility and inductive bars
We establish statements of weakened variants of (the contrapositive of) Kőnig’s lemma, assuming e.g. the existence of a cover for the root of the “tree.”
Theorem 21 (Kőnig’s lemma for inductive covers).
Let us assume a finitely branching binary relation , i.e. , a -upward closed unary relation , a root which is -covered by . Then the paths which refute at their tail are represented in at , i.e. .
Proof.
Using the length of paths, we define , the circle (centered at ) of radius , and the collection of of finite supports of some circle as
Because has finite direct images, we deduce that circles are finite, by induction on . Hence we get .
Let us show that meets . Indeed, as we assume , using the FAN Theorem 14 for covers we get . Then we use with . We only need to show that holds at and is -unstoppable i.e. :
-
holds because is a support for the circle of radius ;
-
is -unstoppable because the circle of radius is a -image of that of radius .
As meets , then contains some circle, i.e. there is such that . As a consequence, since -paths from of length greater that cross hence meet at that crossing point, their tail must belong to as well, because is -upward closed. Hence holds and we conclude using Theorem 20.
This proof uses the FAN Theorem 14 for inductive covers, and then combines it with the characterization. The finiteness of circles , which lives (and not in ), is not strong enough to be able to define as a map , which would be needed if the characterization were to be used instead of .
As the instance of Theorem 21 where , we recover a finitary form of Kőnig’s lemma similar to [1, p. 15]. A direct proof by induction on (the proof of) would probably be shorter but we here illustrate the generality of Kőnig’s lemma for inductive covers.
Corollary 22 (Kőnig’s lemma for accessibility [1]).
Let be a binary relation s.t. and let be a -accessible point of , i.e. . Then there is a rose tree with root such that the -paths from are exactly the branches of .
We present a variant of Kőnig’s lemma for inductive bars. It is not exactly an instance of Theorem 21 because the properties of paths are not limited to those of their endpoint.
Theorem 23 (Kőnig’s lemma for inductive bars).
Let us assume a finitely branching binary relation , a monotone unary relation , and a point . If then .
Proof.
The proof is comparable (not identical) to the proof of Theorem 21 and uses and instead as replacements for and .
5.4 Kőnig’s lemma for sequences of finite choices
Bar predicates can be specialized using the notion of good sequence, i.e. one containing a redundant pair w.r.t. a binary (redundancy) relation. This relation can be the identity, but there are other interesting cases, e.g. multiset inclusion [20]. In this case, bar predicates characterize inductive almost full relations [20, 31].
We assume a binary relation to represent a notion of redundancy, and define two unary relations and of type , characterizing lists which contain a good pair, and characterizing lists which are irredundant, i.e. avoiding good pairs:171717See [21] for an equivalent inductive characterization of .
It is obvious that is monotone. Moreover, we show the correspondence between bad (i.e. not good) lists and irredundant ones:181818 and use in opposite ways, hence the use of the erse function.
Definition 24 (Almost full relation [31]).
For binary relations , we define the predicate using the two inductive rules, where :
We recall that is another way of stating (i.e. is equivalent to) (see e.g. [20, p. 11] or [21]) but below we just need the implication in this direction:
Proof.
First we establish by induction on . As an instance where , we get . Then we can show the implication by induction on .
We can deduce usual the sequential characterization of almost full relations, but, as with covers and bars, this characterization is constructively weaker.
Proof.
We obtain such that using above, followed by from Section 3.5. We conclude by analyzing the identity where holds.
We finish our tour of weakened forms of Kőnig’s lemma with a slightly different form where the outcome is not a representing rose tree but just its height, hence a bound on the length of its branches. In light of Theorem 20, these are equivalent conditions for finitely branching relations. While we insisted so far on getting tree representations in the spirit of Kőnig’s lemma, in its applications on e.g. termination, a bound on the height of this tree is often sufficient to conclude.
Given a sequence of relations , we define a predicate such that , i.e. holds exactly when the members of are successive choices in , , …
Theorem 25.
Given an almost full relation, i.e. s.t. , and a sequence of finite unary relations, i.e. s.t. . Then the length of irredundant choice lists for is (uniformly) bounded. Formally, we get:
Proof.
From , we know that holds and we apply the form of Theorem 15 and derive .
We define , meaning that is a supporting list for the (finite) unary relation . We use the characterization of inductive bars applied to with . We get such that and .
Then we check that satisfies the property . The same value then bounds the length of irredundant choice lists for .
Again, we use a combination of a FAN theorem and the negative characterization of inductive bars. The assumption of finiteness is not strong enough to be able to build a sequence that enumerates the respective supports for , , … but the negative characterization allows us to reason without escaping from the sort.
5.5 Type-bounded variants and the FAN functional
To answer a question of one of the reviewers, we briefly discuss how the FAN theorem for covers and its consequences can be lifted to -bounded variants allowing for the computation of FAN functionals, which output bounds on the length of branches of finite trees. For this, the types of the , or predicates are lifted as:
and, as a consequence, parts of the and library results need to be given -bounded variants as well. Noticeably, the transition relation argument in is lifted, and not only its output sort.
In Coq jargon, we say that those predicates become informative, meaning that their inductive structure can be used to compute values of sort , typically bounds on the length of branches in . As an illustration here, these variants include the following FAN functional, lifting Theorem 25 above to an output of sort :
where is the lifting of finiteness.
6 Two examples of replacements of Kőnig’s lemma
In this section, we discuss two applications of our constructive variants of Kőnig’s lemma that allow to transfer some “classical” proofs into the realm of constructive mathematics.
6.1 The decidability from implicational relevance logic
In [20], we use a variant of Kőnig’s lemma for almost full relations, corresponding here to Theorem 25, to show the termination of an exhaustive proof search procedure for implicational relevance logic (IR), based on a sequent system designed by Curry [8]. The termination of this system was established by Kripke [17], building on Curry’s work, rediscovering Dickson’s lemma, and concluding with Kőnig’s lemma.
The idea of the proof is the following. Curry’s sequent proof system is proved sound and complete for IR. It has three essential properties:
-
each sequent rule has finitely many premises, in fact less than two;
-
for any conclusion, there are only finitely many rule instances having that conclusion;
-
there is a notion of redundancy for sequents such that, if a sequent is redundant over , then any proof of can be contracted into a proof of of lesser height. This property is called Curry’s lemma.
Kripke proved that the notion of redundancy, derived from the natural inclusion ordering on multisets, forms a well quasi order (WQO), and thus any sequence of sequents contains a redundant pair. Notice that the WQO terminology and Dickson’s lemma, the key ingredient in the result, were only popularized later on. Then, using Curry’s lemma, Kripke argued that any proof search branch must contain a redundant pair, and by Kőnig’s lemma, the proof search tree for irredundant proofs is finite.
Replacing the classical approach to WQOs by inductive almost full relations, in [20] we prove that the notion of redundancy is almost full, the constructive form of Dickson’s lemma been derived from Coquand’s constructive form of Ramsey’s theorem [31]. Then we use the -bounded variant of Theorem 25 called and outlined in Section 5.5 to show that the irredundant part of the proof search tree has a computable bound on its height, so the search process can be safely pruned above that height.
6.2 Building Harvey Friedman’s monster
In [23], we build on a Coq constructive proof of Kruskal’s tree theorem [22] to implement function (that we specify below), invented and studied by Harvey Friedman [11] in his groundbreaking work on reverse mathematics.
The (homeomorphic) embedding on rose trees is a WQO as soon as the comparison between decorations of the nodes is itself a WQO: this is the statement of Kruskal’s theorem in a classical setting. In [22], we implement a constructively provable form by replacing WQOs with (inductive) relations (see Definition 24). Notice that this constructive form of Kruskal’s theorem has a quite involved proof that we do not discuss here.
Using Kruskal’s theorem, the homeomorphic embedding between roses trees decorated with elements of the finite set is and we use this relation as our redundancy relation. This means, using the sequential characterization of Section 5.4, that any sequence , ,… of roses trees contains a redundant pair. Now Friedman bounds the number of possible choice for by requiring that its size (number of nodes) is less than : we say that is sized. Hence, considering the set of all such sized sequences , they form a finitely branching tree and all infinite branches contain a redundant pair. Following the argumentation of e.g. [13], by Kőnig’s lemma, the irredundant part of that tree is finite and thus sized sequences have maximal length, which is by definition .
We circumvent this classical argumentation by applying Theorem 25, hence, according to its proof, first applying the FAN theorem for inductive bars and then the negative characterization of inductive bars. We obtain, constructively, the existence of a uniform bound on the length of irredundant sequences of sized trees . The exact value of the bound, i.e. , can then be computed by unbounded linear search [23].191919Using a -bounded variant of Theorem 25, one can use bounded linear search instead of unbounded linear search. However, there is little to gain in obtaining an efficient algorithm for computing since writing in decimal would already exhaust all atoms of the known universe.
7 Conclusion
Besides the Coq script that supports the results presented herein, we can summarize our contributions as following. We show that the notion of inductive cover generalizes both accessibility and bar inductive predicates, hence we can discuss concepts and results at the level of covers and they instantiate on these restricted notions as well. We follow Coquand’s program [6] and replace characterizations based on sequences with inductive ones, that constructively do not fall short on lawless sequences.
We compare the strength of the positive, negative and sequential characterizations of covers, or (as an instance) of “being a bar,” both in constructive and classical contexts. We analyze the precise roles played by the axioms of excluded middle and dependent choice.
The negative characterization is a remarkable intermediate notion: a) it is a De Morgan dual of the positive characterization; b) it expels determinism from the sequential characterization, and shares properties with Brouwer’s notion of spread; c) it is relevant in practice, for instance when dealing with -bounded Coq definitions.
We give a concise constructive proof of a FAN theorem for inductive covers that generalizes the type theoretic interpretation of the FAN theorem for inductive bars [10]. We notice that the respective core argument of these two proofs differ significantly.
The negative or sequential characterizations of covers (or bars) are weaker than the positive/inductive characterization. They fail when trying to constructively establish important closure properties, such as the FAN theorem. However, they can still be used constructively, after the inductive FAN theorem, to obtain uniform bounds on the length of branches of trees. This is the core argumentation behind several weaker variants of Kőnig’s lemma that we derive and present, herein insisting on representations by inductive rose trees.
To conclude, we discuss two applications of those constructive variants of Kőnig’s lemma that allow the transport of classical results in the constructive realm.
Almost full relations give a satisfactory constructive account for the notion of well quasi order, i.e., finitary closure properties such as Dickson’s lemma, Higman’s lemma and Kruskal’s tree theorem can be constructively established with this notion. However, as far as we are aware, the stronger notion of better quasi order (BQO) has not yet been given a suitable inductive account, and it would be quite a challenge to lean towards an inductive definition of BQOs, hopefully satisfying additional infinitary closure properties.
References
- [1] F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998.
- [2] J. Berger. Brouwer’s fan theorem, 2021. doi:10.48550/arXiv.2001.00064.
- [3] J. Berger and H. Ishihara. Brouwer’s fan theorem and unique existence in constructive analysis. Mathematical Logic Quarterly, 51(4):360–364, 2005. doi:10.1002/malq.200410038.
- [4] J. Berger and G. Svindland. Brouwer’s fan theorem and convexity. The Journal of Symbolic Logic, 83(4):1363–1375, 2018. doi:10.1017/jsl.2018.49.
- [5] C. Cheung. Brouwer’s Fan Theorem: An Overview. Master’s thesis, Cornell University, 2015. URL: https://api.semanticscholar.org/CorpusID:203584866.
- [6] T. Coquand. About Brouwer’s Fan Theorem. Revue internationale de philosophie, 230:483–489, September 2004. URL: http://www.jstor.org/stable/23955601.
- [7] T. Coquand, G. Sambin, J. Smith, and S. Valentini. Inductively generated formal topologies. Annals of Pure and Applied Logic, 124(1):71–106, 2003. doi:10.1016/S0168-0072(03)00052-6.
- [8] H. B. Curry. A Theory of Formal Deductibility. Notre Dame mathematical lectures. University of Notre Dame, 1957.
- [9] M. Escardo. Infinite sets that admit fast exhaustive search. In 22nd Annual IEEE Symposium on Logic in Computer Science (LICS 2007), pages 443–452, 2007. doi:10.1109/LICS.2007.25.
- [10] D. Fridlender. An Interpretation of the Fan Theorem in Type Theory. In Types for Proofs and Programs, pages 93–105. Springer Berlin Heidelberg, 1999. doi:10.1007/3-540-48167-2_7.
- [11] H. M. Friedman. Internal finite tree embeddings. In Reflections on the Foundations of Mathematics: Essays in Honor of Solomon Feferman, Lecture Notes in Logic, pages 60–91. Cambridge University Press, 2002.
- [12] M. Fujiwara. Kőnig’s lemma, weak Kőnig’s lemma, and the decidable fan theorem. Mathematical Logic Quarterly, 67(2):241–257, 2021. doi:10.1002/malq.202000020.
- [13] J. H. Gallier. What’s so special about Kruskal’s theorem and the ordinal ? A survey of some results in proof theory. Annals of Pure and Applied Logic, 53(3):199–260, 1991. doi:10.1016/0168-0072(91)90022-E.
- [14] W. Hanf. Nonrecursive Tilings of the Plane. I. The Journal of Symbolic Logic, 39(2):283–285, 1974. doi:10.2307/2272640.
- [15] H. Ishihara. Weak Kőnig’s Lemma Implies Brouwer’s Fan Theorem: A Direct Proof. Notre Dame Journal of Formal Logic, 47(2):249–252, 2006. doi:10.1305/ndjfl/1153858649.
- [16] S. C. Kleene and R. E. Vesley. The Foundations of Intuitionistic Mathematics: Especially in Relation to Recursive Functions. North-Holland Publishing Co., 1965.
- [17] S. Kripke. The Problem of Entailment (abstract). Journal of Symbolic Logic, 24:324, 1959.
- [18] D. Kőnig. Über eine Schlussweise aus dem Endlichen ins Unendliche. Acta Sci. Math. (Szeged), 3(2–3):121–130, 1927.
- [19] D. Larchey-Wendling. Constructive substitutes for Kőnig’s lemma (artifact). Software, NARCO (ANR-21-CE48-0011), swhId: swh:1:dir:611c848b0dbc19c9de20744122776440c00e413d (visited on 2025-05-25). URL: https://github.com/DmxLarchey/Constructive-Konig, doi:10.4230/artifacts.23151.
- [20] D. Larchey-Wendling. Constructive Decision via Redundancy-Free Proof-Search. Journal of Automated Reasoning, 64:1197–1219, 2020. doi:10.1007/s10817-020-09555-y.
- [21] D. Larchey-Wendling. Quasi Morphisms for Almost Full Relations. In 30th International Conference on Types for Proofs and Programs, TYPES, 2024. URL: https://easychair.org/publications/preprint/M3Km.
- [22] D. Larchey-Wendling. The Coq-Kruskal project, April 2024. URL: https://github.com/DmxLarchey/Coq-Kruskal.
- [23] D. Larchey-Wendling. The Friedman-TREE project, November 2024. URL: https://github.com/DmxLarchey/Friedman-TREE.
- [24] D. Myers. Nonrecursive Tilings of the Plane. II. The Journal of Symbolic Logic, 39(2):286–294, 1974. doi:10.2307/2272641.
- [25] C. Sacerdoti Coen and S. Valentini. General Recursion and Formal Topology. In PAR-10. Partiality and Recursion in Interactive Theorem Provers, volume 5 of EPiC Series in Computing, pages 72–83. EasyChair, 2012. doi:10.29007/hl75.
- [26] S. G. Simpson. Subsystems of Second Order Arithmetic. Perspectives in Logic. Cambridge University Press, 2 edition, 2009.
- [27] A. S. Troelstra. Note on the Fan Theorem. The Journal of Symbolic Logic, 39(3):584–596, 1974. doi:10.2307/2272902.
- [28] A. S. Troelstra. Some Models for Intuitionistic Finite Type Arithmetic with Fan Functional. The Journal of Symbolic Logic, 42(2):194–202, 1977. doi:10.2307/2272120.
- [29] W. Veldman. Brouwer’s Real Thesis on Bars. Philosophia Scientiæ, pages 21–42, 2006. doi:10.4000/philosophiascientiae.404.
- [30] W. Veldman. Brouwer’s Fan Theorem as an axiom and as a contrast to Kleene’s alternative. Arch. Math. Logic, 53:621–693, 2014. doi:10.1007/s00153-014-0384-9.
- [31] D. Vytiniotis, T. Coquand, and D. Wahlstedt. Stop When You Are Almost-Full. In Interactive Theorem Proving, pages 250–265. Springer Berlin Heidelberg, 2012. doi:10.1007/978-3-642-32347-8_17.
