TITLE: The resemblance between Mordell's theorem and Dirichlet's unit theorem
QUESTION [42 upvotes]: The first one states that if $E/\mathbf Q$ is an elliptic curve, then $E(\mathbf Q)$ is a finitely generated abelian group. 
If $K/\mathbf Q$ is a number field, Dirichlet's theorem says (among other things) that the group of units $\mathcal O_K^\times$ is finitely generated. 
The proof of Mordell's theorem and the proof of Dirichlet's theorem are somewhat similar (a covolume calculation in one case, and what feels to me like bounding a covolume in the other).
How can these two objects be realized as instances of the same construction?  Could it be done so well as to reduce the proof of Mordell-Weil and Dirichlet's theorems to a single proof?
In the correspondence between the class number formula and the conjectured formula for the leading term of $L(E/\mathbf Q, s)$ , it appears that $\mathcal O_K^\times$ really does play the role of $E(\mathbf Q)$ (regulator corresponds to regulator, torsion to torsion). From my understanding, the general belief is that these two objets are analogous. But I'm having a hard time putting them on the same footing. 
In fact, there is a generalization of the Birch & Swinnerton-Dyer conjecture to any abelian variety over $\mathbf Q$, but in this case the conjectured leading term of the $L$-function is symmetric in $A$ and $\breve{A}$ (where $\breve{A}$ is the dual abelian variety). This conjecture degenerates to the BSD conjecture in the case of an elliptic curve, which is self-dual. 
But $\mathcal O^\times$ isn't an abelian variety. At best, $\mathcal O_K^\times$ can be thought as the $\mathcal O_K$-valued points of the group scheme $\mathbf G_m = \text{Spec }(\mathbf Z[x,y]/(xy-1))$. But: (1), $\mathbf G_m$ isn't an abelian variety over any field, and (2), we are looking at its points in the ring of integers of a number field, rather than in a field. So, why should we expect it to be the same as $E(\mathbf Q)$?
Or, perhaps $E(\mathbf Q)$ and $\mathcal O_K^\times$ the wrong objects to be trying to compare?

REPLY [3 votes]: I write a different answer because the first one is begins to be too long.

Let $S$ be a finite set of primes in $K$. Let G be a smooth (finite type) commutative group scheme over $O_S$ with semi-abelian generic fiber $G_K$. Then $G(O_S)$ is a finitely generated abelian group. 

Proof. Let $L$ be any finite extension of $K$ and let $S'$ be any finite set of primes of $L$ containing those dividing a prim of $S$, then  $G(O_S)$ is canonically a subgroup of $G(O_{S'})$, and it is enough to show $G(O_{S'})$ is finitely generated. Note that $G(O_{S'})=G_{O_{S'}}(O_{S'})$ and $G_{O_{S'}}$ is again a smooth finite type commutative group scheme over $O_{S'}$. 
The generic fiber $G_K$ is extension of an abelian variety $A_K$ by a torus $T_K$. Enlarging $K$ if necessary we can suppose $T_K$ is split ($\simeq \mathbb G_{m, K}^d$). Enlarging $S$ if necessary, we can suppose that $A_K$ has good reduction over $O_S$. Let $A$ be the abelian scheme over $O_S$ extending $A_K$. Then $G_K\to A_K$ extends to $G\to A$ by Néron mapping property. The kernel is a finite type model of $T_K$. Enlarging again $S$, we can suppose it is isomorphic to $\mathbb G_{m, O_S}^d$. So we ended up with an exact sequence 
$$ 1\to \mathbb G_{m, O_S}^d\to G\to A \to 0.$$
Taking $O_S$-sections, we get
$$ 1\to (O_S^*)^d \to G(O_S) \to A(O_S)=A(K). $$ 
Using Mordell-Weil and the weak Dirichlet, we see that $G(O_S)$ is a finitely generated abelian group. 
The above statement is of course well known. A colleague of mine tells me this should be in P. Vojta's papers "Integral Points on Subvarieties of Semiabelian Varieties".