As discussed at length on the mailing list some time ago, there are several different things that one might mean by saying that a function is “constant”. Here is my preferred terminology:
is constant if we have
such that
for all
.
This is equivalent to saying thatfactors through
.
is conditionally constant if it factors through
.
is weakly constant if for all
we have
.
In particular, the identity function of is conditionally constant, but not constant. I don’t have a problem with that; getting definitions right often means that they behave slightly oddly on the empty set (until we get used to it). The term “weakly constant” was introduced by Kraus, Escardo, Coquand, and Altenkirch, although they immediately dropped the adjective for the rest of their paper, which I will not do. The term “conditionally constant” is intended to indicate that
is, or would be, constant, as soon as its domain is inhabited.
It’s obvious that every constant function is conditionally constant, and shows the converse fails. Similarly, it’s easy to show that conditionally constant implies weakly constant. KECA showed that the converse holds if either
is a set or
, and conjectured that it fails in general. In this post I will describe a counterexample proving this conjecture.
First of all, we have to be a little careful, because for general types none of the notions of constancy are mere propositions. So it’s a different thing to ask whether “weakly constant implies conditionally constant” or whether “merely weakly constant implies merely conditionally constant”. In fact, the latter is consistent, because it follows from , which in turn follows from LEM (it is the “propositional axiom of choice”). In particular, in the simplicial set model, merely weakly constant does imply merely conditionally constant.
However, I claim that the stronger statement “weakly constant implies conditionally constant” is actually inconsistent with univalence. The consistency of the truncated version of the statement means that we can’t expect to exhibit a single counterxample to the stronger statement in the empty context. But we can hope to find a family of counterexamples, along the lines of Theorem 3.2.2 in the book, showing that there cannot be any uniform proof of conditional constancy from weak constancy. To do this, we will use two standard techniques for constructing counterexamples: (1) consider the universal case, and (2) make simplifying assumptions.
To start with, we’re looking for a family of functions which are all weakly constant, but which are not all conditionally constant. A first simplification we can try is to let
be a constant family, so that we’re looking for
.
But now, given and
, there is a universal such family, where
and
is the pairing function. What does it mean to say that for all
the function
is weakly constant? Well, it means that for any
and
we have an identification
, which is to say we have
such that
. In other words, the loops at
act “transitively” on the points of
. (Of course there is no hope of this happening nontrivially if
is a set, but we already knew we would need types that aren’t sets for our counterexample.)
Now let’s consider a universal case again: fix a type and let
, with
the universal family defined by
. Now weak constancy of each
means that if
, then the automorphisms of
act transitively on
, i.e. for any
there is
such that
. This is something we’ve seen before: Nicolai called this property of
being homogeneous. Types with decidable equality are homogeneous, including finite types, and decidable equality is preserved by mere equivalence (since it is itself a mere property). So now we have a bunch of examples of families of weakly constant functions, and we can ask whether any of them fail to be all conditionally constant.
Going back to a general and
with
, what does it mean to say that for all
the function
is conditionally constant? Let’s suppose for simplicity that every type
is inhabited, so that conditional constancy is the same as constancy. In that case, what we would be claiming is that there is a function
such that for all
and
we have
. Note that the first component of
need not be the identity map. However, we can re-express this by saying that the composite
is the identity, where the first map is the first projection. In other words,
would be a retract of
.
Now let’s go back to our examples of families of weakly constant functions, and pick one that’s easy to reason about: let be a finite set of cardinality
. Then
is the classifying space of the symmetric group
, incarnated as the “type of finite sets of cardinality
“. What is
? It’s the type of pointed finite sets of cardinality
. Since this is connected, it is also the classifying space of a group, and in fact the group in question is
: an automorphism of a pointed
-element set must fix the basepoint, hence is uniquely determined by an automorphism of the remaining
elements. Under this identification, the projection
is identified with the map
induced by the inclusion
.
Thus, if our family of functions in this case were all conditionally constant, this map would have a retraction. Taking loop spaces, we conclude that
would have a retraction in the category of groups. This is starting to look fishy, and indeed it is rarely the case. It’s true “by accident” for
, but after that it starts failing. For instance, when
, we have
and
, so the kernel of any surjection
would have cardinality 5; but since 5 is coprime to 24, all 5-cycles would have to be in that kernel, and there are more than five 5-cycles in
. Thus, it is false that our family of maps are all conditionally constant; and since they are all weakly constant, it is false that every weakly constant function is conditionally constant.
I enjoy this example quite a lot, because in addition to concepts from HoTT, it uses some not-entirely-trivial facts from finite group theory, notably Lagrange’s theorem. (Of course, it could be that there’s a much simpler counterexample waiting to be found; consider that a challenge!) I’ve almost finished formalizing it in the HoTT Coq library. What’s left is to show that 5-cycles have order 5 and that there are more than 5 of them, which should be straightforward but is a little tedious. (I would have waited to post this until the formalization was done, but Martín Escardó is going to give a related talk in Poland in a few weeks, and asked that I make this example public before then.)