Let $H$ be a quaternionic algebra over ${\bf Q}$, and let $R$ denote a maximal ${\bf Z}$-order in $H$. Is there a theorem on the structure of the units in $R$ analogous to the Dirichlet unit theorem? Is there an analogous theorem for the $S$-units?



Units in quaternionic algebras
If $H$ is definite, then the group of units of $H$ is finite. If $H$ is indefinite, then the group of units is a pretty chunky group; it embeds as a cocompact discrete subgroup of $SL(2, R)$, and the rank of its abelianization (which, if I remember correctly, can be interpreted geometrically as twice the genus of an associated modular curve) can be arbitrarily large. 


All of this follows from general theorems on arithmetic subgroups of algebraic groups; this is a classical theory going back to Borel, Harish-Chandra and Ono in the 60s, and there is a nice summary in Gross's paper "Algebraic modular forms".


EDIT: You asked about S-units. Let S be a set of finite primes. If $H$ is definite, then the group of S-units in H will be a discrete cocompact subgroup of 


$\prod\_{p \in S} (H \otimes \mathbb{Q}\_p)^\times$.


If every place in $S$ is ramified in $H$, then the kernels of the reduced norm maps $(H \otimes \mathbb{Q}\_p)^\times \to \mathbb{Q}\_p^\times$ are compact, so this group above maps with finite kernel to a discrete subgroup of $\prod\_{p \in S} \mathbb{Q}\_p^\times$ and hence its abelianization has rank equal to the size of S. This argument can be pushed substantially further: you can show that if H is a quaternion algebra over a totally real field F which is totally definite (i.e. definite at every infinite place of F), then the map from S-units of H to S-units of F has finite kernel and cokernel, so the abelianization of the S-units of F has rank $|S| + [F : \mathbb{Q}] - 1$.


My favourite case, though, is when $F = \mathbb{Q}$, $H$ is definite, and $S$ consists of a single finite place $p$ which is *not* ramified in $H$. Then the S-units of $H$ embed into $GL(2, \mathbb{Q}\_p)$ as a discrete co-compact subgroup $\Gamma$, and the space of continuous functions on the quotient $GL(2, \mathbb{Q}\_p) / \Gamma$ gives a representation of $GL(2, \mathbb{Q}\_p)$ with many fascinating properties (it is an example of one of Matt Emerton's completed cohomology spaces).


