Imagine you’re organizing your bookshelf. You have “books” (which we’ll call “terms”), and you group them into “categories” like fiction, history, and science (we’ll call these groups “types”). Sometimes, you notice two books are essentially the same—maybe you have two copies of the same novel. That similarity is what we call an “identity type”—it’s how we say two things are equal within a category.
Now, some categories are very straightforward. Imagine a category containing only “true” and “false.” Here, everything is clear-cut: two things are either identical or they’re not. This kind of category is called a “proposition” or a “truth value”—it’s like a simple yes/no question.
But not all categories are that simple. Think of a category with two distinct items, like an apple and an orange. There’s no inherent “sameness” between them. In this case, the category itself is what we call a “set.”
It gets more interesting. Consider a category containing different sets themselves. Imagine one set is {apple, orange} and another is {banana, pear}. There might be multiple valid ways to consider these sets “equal.” You could pair apple with banana and orange with pear, or you could pair apple with pear and orange with banana. Each pairing is a valid “equality,” so the category of these sets isn’t just a simple set—it’s richer, what we call a “groupoid.”
This idea can keep going. You can have categories where the ways things are equal are themselves complex, leading to “2-groupoids,” “3-groupoids,” and so on. At the most general level, you have categories where the notion of equality is as rich and layered as the objects themselves—these are called “∞-groupoids.”
In essence, homotopy type theory is a way to formalize how we think about sameness and structure across different levels of complexity, from simple true/false questions to the most intricate mathematical objects.