Constructing the Propositional Truncation using Nonrecursive HITs
source link: https://homotopytypetheory.org/2015/07/28/constructing-the-propositional-truncation-using-nonrecursive-hits/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Constructing the Propositional Truncation using Nonrecursive HITs
In this post, I want to talk about a construction of the propositional truncation of an arbitrary type using only non-recursive HITs. The whole construction is formalized in the new proof assistant Lean, and available on Github. I’ll write another blog post explaining more about Lean in August.
The construction of the propositional truncation of a type is as follows. Let be the following HIT:
HIT {-} (A : Type) : Type :=
| f : A → {A}
| e : ∀(a b : A), f a = f b
I call this the “one step truncation”, because the HIT is like the propositional truncation, but takes out the recursive part. Martin Escardo calls this the generalized circle, since . We can repeat this multiple times: and . Now the colimit of this sequence is the propositional truncation of : . To make sure we’re on the same page, and to introduce the notation I use for the constructors, the (sequential) colimit is the following HIT: (I will mostly leave the arguments in implicit)
HIT colimit (A : ℕ → Type)
(f : ∀(n : ℕ), A n → A (n+1)) : Type :=
| i : ∀(n : ℕ), A n → colimit A f
| g : ∀(n : ℕ) (a : A n), i (f a) = i a
Below I’ll give an intuition of why the construction works, and after that a proof. But first I want to talk about some consequences of the construction.
First of all this is the first instance of a HIT which has a recursive path constructor which has been reduced to non-recursive HITs. During the HoTT workshop in Warsaw there was a conjecture that all HITs with recursive (higher) path constructors can be reduced to HITs where only point constructors are allowed to be recursive. Although I have no idea whether this conjecture is true in general, this is the first step towards proving it.
Secondly, this gives an alternative answer to the question about the universal property of the propositional truncation. This construction shows that (using function extensionality) a function for an arbitrary type is “the same” as a sequence of functions (with defined above) such that for all we have . In a formula
.
So, why does the construction work?
To give an intuition why this works consider the propositional truncation of the booleans, . Of course, this type is equivalent to the interval (and any other contractible type), but there is actually a little more going on. The path constructor of the propositional truncation (let’s call it here) gives rise to two paths between and : and . Since the resulting type is a mere proposition, these paths must be equal. We can construct a path between them explicitly by using the continuity of . We can prove that for every and every we have by path induction, and this leads to the conclusion that any two elements in are equal. This is exactly the proof that any proposition is a set.
Now consider the type . This is a type with points and and we have two paths from to . Let’s call them and . These two paths are not equal. Of course, we also have a loop at both and .
However, in the type the corresponding paths and of type are equal. To see this, we can mimic the above proof. We can prove that for all and all we have , just by path induction on . Then we can conclude that . Of course, in there are new paths of type , but they will be identified again in .
<sidenote>
The above argument also shows that if any function is weakly constant, then is weakly constant for any (using the terminology of this post).
</sidenote>
So this is the intuition why is the propositional truncation of . In a path is added between any two points of , between any two existing parallel paths (and between any two parallel higher paths). Then in higher paths are added between all newly introduced (higher) paths, and so on. In the colimit, paths exist between any two points, parallel paths, and parallel higher paths, so we get the propositional truncation.
The proof.
But this is just the intuition. How do we prove that we get the propositional truncation? We clearly get the point constructor for the propositional truncation, because (the constructor of the colimit) has type . Now we still have to show two things:
- We have to show that is a mere proposition
- We have to construct the induction principle for the propositional truncation on , with the judgmental computation rule
2. The second part is easy. If we’re given a family of propositions with a map we have to construct a map . We do this by induction on . Since we construct something in , which is a mere proposition, the path construction is automatic, and we only have to deal with the case that for some and . Now we do induction on .
If , we can choose the element .
If , we know that , so we can induct on . If , we need an element of . We have an element of by induction hypothesis. So we can transport this point along the equality to get the desired point. The path construction is again automatic. In pattern matching notation we have defined:
- and
- .
The definition is also the (judgmental) computation rule for the propositional truncation.
1. So we only need to show that is a mere proposition, i.e. . We first do induction on . Note that is a mere proposition. (Left as exercise to the reader. Hint: assume that it is inhabited.) So we only have to consider the case where is a point constructor, say . Now we do induction on . Now the goal is , and we don’t know (yet) that this is a mere proposition, so we have to show two things:
- We have to construct a for all ;
- We have to show that satisfies the following coherence condition: .
In particular, we want to make the construction of as simple as possible, so that the coherence condition for remains doable.
For the construction of , let’s first consider a special case where and live in the same level, i.e. where . This will be used in the general construction. In this case, we have , where the second equality is by the path constructor of and the other two equalities are by the path constructor of the colimit. Let’s call this equality .
For the general construction of with arbitrary and , I have considered three approaches. I will first discuss two approaches where I failed to complete the proof.
(failed) Approach 1. Induct on both and . In the successor case, induct on and . Unfortunately, this becomes horrible very quickly, because we now have a nested double induction on HITs. This means that we already need to prove coherence conditions just to construct , and after that we still need to show that satisfies a coherence condition. I quickly gave up on this idea.
(failed) Approach 2. Lift and both to by repeatedly applying , and then show that , where the second equality is . This works, but there is a catch: lives in and lives in (assuming addition is defined by induction on the second argument). So to complete the construction, we also have to transport along the equality . This is fine, but for the coherence condition for this transport becomes an annoying obstacle. Showing the coherence condition is possible, but I didn’t see how to do it. Then realized there was a more convenient approach, where I didn’t have to worry about transports.
(succeeded) Approach 3. Distinguish cases between and and induct on those inequalities. I’m assuming that the inequality is defined by an (ordinary) inductive family
inductive le (n : ℕ) : ℕ → Type :=
| refl : le n n
| step : Π(m : ℕ), le n m → le n (m+1)
This definition gives a very useful induction principle for this construction. If we can construct a map by induction on :
- ;
- .
I use the notation for this, similar to , because we repeatedly apply and the number of times is determined by . Since the type is a mere proposition, doesn’t really depend on , only on the fact that its type has an inhabitant.
We can now also show that by induction on as concatenation of multiple s. Now if we can construct by , where the first equality is . The case is similar.
This is a nice and simple construction of (without transports), and we can prove the coherence conditions using this definition, but that is more involved.
We have constructed in such a way that for we have that equals and in the case that we have that equals . This is not purely by definition, for the case we have to prove something here, because we cannot get both inequalities by definition.
Now we have to show that . We distinguish two cases: and .
Case
In this case we can find and . In this case and
The situation is displayed below (click image for larger view). Some arguments of paths are omitted, and the maps and are also omitted for readability (the actual equalities live in ). We need to fill the pentagon formed by the outer (thick) equalities.
By induction on we can find a path and by another induction on we can fill the bottom square in the diagram. We will skip the details here. The top triangle can be filled for a general path by induction on . This finishes the case .
Case
Now we can find and . Here and . The situation is below.
If we choose correctly (namely as ), then by definition and , so the triangle in the left of the diagram is a definitional equality. We can prove the remaining square in more generality. See the below diagram, where we mention explicitly.
The bottom square is filled by induction on . To show that the two paths in the top are equal, first note that is weakly constant, because that is exactly the type of . So is weakly constant. This finishes the case , and hence the proof that is a mere proposition.
Future Work
The natural question is whether we can construct arbitrary -truncations using non-recursive HITs. The construction in this post can be easily generalized by using an “one-step -truncation,” but the proof that the resulting type is -truncated cannot be generalized easily. However, Egbert Rijke has a proof sketch of the construction of localizations between -compact types using nonrecursive HITs, and these include all the -truncations.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK