From a [recent answer](https://mathoverflow.net/questions/289259/the-derived-drift-is-pretty-unsatisfying-and-dangerous-to-category-theory-or/289609#289609) by Mike Shulman, I read:



> 
> "HoTT is (among other things) a foundational theory, on roughly the same ontological level as ZFC, whose basic objects can be regarded as $\infty$-groupoids"
> 
> 
> 


Now, $\infty$-groupoids are the same thing as spaces, and I have a couple of spaces which I like.  

Here's one which I like a lot: the Lie group $SU(n)$.



> 
> **Question:**  
>  How do I say "let $X:=SU(n)$" in HoTT?  
>   
> 
>  Here, $n$ can be either a variable, or a definite number (say $3$).
> 
> 
> 


*Disclaimer:* I (unfortunately) don't know much about HoTT. So please be gentle.



Defining $SU(n)$ in HoTT
This isn't easy to do, and the reason it isn't easy is because of the step "$\infty$-groupoids are the same thing as spaces." Of course the homotopy hypothesis tells you that any $\infty$-groupoid is equivalent to the fundamental $\infty$-groupoid of a space, but that doesn't mean that they're literally the same thing. The way that HoTT approaches about $\infty$-groupoids is *not* by thinking of them as spaces. What's easy in HoTT is to do something like, "consider the $\infty$-groupoid freely generated by a single point and a single 1-path from that point to itself." This $\infty$-groupoid is equivalent to the fundamental $\infty$-groupoid of classical circle, but we haven't constructed it that way, instead we've constructed it algebraically via generators/relations.


Ok, so the first thing you could do is find an "algebraic" description of the fundamental $\infty$-groupoid of $\mathrm{SU}(n)$. Essentially this is giving an explicit CW-decomposition of $\mathrm{SU}(n)$. I'm not sure how hard this is off the top of my head, but one needs to be a bit careful with such an approach to make sure to get something that's *just as useful* as $\mathrm{SU}(n)$ in practice. For example, as suggested in comments it would be better to construct $B\mathrm{SU}(n)$ instead so that when you take the loop space you know you have a group structure. But you also want to be able to handle things like the relationship between $\mathrm{SU}(n)$ and complex vector bundles, and if your construction is sufficiently messy and computational then it might not be good enough.


Instead, you could try to build up the theory of manifolds (or something similar) inside HoTT and then define a notion of fundamental $\infty$-groupoid. If I understand things right, this is something that [real cohesive type theory](https://arxiv.org/abs/1509.07584) will let you do. But there's a lot you need to do in order to get there, for a first step you need to define $\mathbb{R}$ inside HoTT which has some tricky points because HoTT is naturally constructive, but the Cauchy reals and the Dedekind reals are different constructively. In HoTT $\infty$-groupoids are foundational native objects, but $\mathbb{R}$ is still just as complicated (well, slightly more complicated) as it was classically. From there you can start trying to define manifolds (or some more general notion of a topological space of similar flavor to manifolds) and then defining the fundamental $\infty$-groupoid of such a space. All of this is done in Mike's paper where he develops a type-theory for *topological* $\infty$-groupoids. The theory there is developed to the point where he shows that $\{(x,y)\in \mathbb{R}^2: x^2+y^2=1\}$ is something that you can take the fundamental $\infty$-groupoid (or "shape") which outputs an $\infty$-groupoid and that the answer you get is equivalent to the type-theoretic circle. If I understand everything correctly, you should be able to use this to define the shape of any real algebraic manifold (including $\mathrm{SU}(n)$), as well as many other "geometrically" defined topological spaces.


In conclusion, HoTT does let you deal with $\infty$-groupoids nicely and directly, but doesn't easily give you access to $\infty$-groupoids that are of a topological nature rather than an algebraic nature. In order to access those you still need to build up real analysis and topology or some replacement for them, which takes a bit of work (as it does classically) and also has a few tricky points due to the constructive nature of HoTT.


