In the short paper [On the Tate–Shafarevich group of a number field][1] of Sameer Kailasa, he reviews a curious phenomenon by which the class group of a number field $K$ appears as the exact kernel of the following morphism:

$$\DeclareMathOperator\Spec{Spec}H^1(\Spec(K),\mathcal{O}_{\bar{K}}^\times)\rightarrow\prod_{\nu\in N_K}H^1(\Spec(K_\nu),\mathcal{O}_{\bar{K_\nu}}^\times)$$

where $N_K$ is the set of (non-archimedean) places of $K$. 

As you may know, the Tate–Shafarevich group $Ш(E/K)$ of an elliptic curve (or more generally any abelian variety) $E$ defined over $K$ is the kernel of this:

$$H^1(\Spec(K), E(\bar{K}))\rightarrow\prod_{\nu\in M_K}H^1(\Spec(K_\nu),E(\bar{K}))$$

with $M_K$ the set of *all* places of $K$. This leads one to the hypothesis of a supposed single calculation which provides both the class group of the number field and the Tate–Shafarevich group of an abelian variety, perhaps with some correction terms for the archimedean places. In this question, I will consider Tate–Shafarevich to be the group formed by restricting only to non-archimedean places; if the elliptic curve is real-connected, there is no difference, and even if it is not then it has the usual Tate–Shafarevich as a subgroup of finite order.

The question [How are the Tate-Shafarevich group and class group supposed to be cognates?][2] on MSE asks for a single reason behind both of these formulations. The most conclusive answer I could find was Kevin Buzzard's paper [Why is an ideal class group a Tate–Shafarevich group][3] (in a [comment](https://math.stackexchange.com/questions/80509/how-are-the-tate-shafarevich-group-and-class-group-supposed-to-be-cognates#comment5545293_80509) by Watson) that explains one way to derive the ideal class group in a manner similarly to Tate–Shafarevich. However, I'm not completely satisfied; to me, this paper describes how $\mathcal{O}_\bar{K}^\times$ and $E(\bar{K})$ are cognates *as Galois-modules,* without very much describing some sort of deeper cognates between the group of units and an elliptic curve.

Another [answer](https://math.stackexchange.com/a/2790139), by user3267, was simply that Tate–Shafarevich is $H^1(X,A)$ for $X=\Spec(\mathcal{O_K})$ and $A$ the Néron model. This answer was much more tempting to me; after all, $H^1(X,\mathbb{G}_m)$ is the ideal class group. Unfortunately, this is oversimplified; while we do see that $\DeclareMathOperator\Cl{Cl}\Cl$ and $Ш$ are both related to $H^1$ computed with coefficients in different abelian sheaves, both can be described as the images of some morphisms $H^1(X,F)\rightarrow H^1(\Spec(K),G)$. In the case of $\Cl$, this morphism is injective, providing an isomorphism with the source, and hence the famous realization that the Picard group of $X$ is the class group of $K$.

To extrapolate on this cohomological interpretation of the groups, we end up constructing a small dictionary:
 - Rational functions $\leftrightarrow$ Néron model $A$
 - $\bar{K}^\times$ $\leftrightarrow$ $E(\bar{K})$
 - Group of units $\mathbb{G}_m$ $\leftrightarrow$ open subscheme $A^0$
 - $\mathcal{O}_{\bar{K}}^\times$ $\leftrightarrow$ global sections $A^0(X)$
 - Divisors $\leftrightarrow$ global sections of $\Phi_A=A/A^0$.

However, in the analogy posited by the adelic kernel formulation, we see that $\mathcal{O}_{\bar{K}}^\times$ should be analogous to $E(\bar{K})$. But the Néron model dictionary posits that $E(\bar{K})$ is actually analogous to $\bar{K}^\times$; which makes a simultaneous proof of both adelic kernels seem impossible! In fact, in order to prove that $H^1(X,A^0)\rightarrow H^1(\Spec(K),E(\bar{K}))$ gives Tate–Shafarevich, you must construct a morphism $H^1(X,A^0)\rightarrow H^1(X,A)$ which it factors through (see [Mazur - Rational points of abelian varieties with values in towers of number fields][4]); but the analogue of $H^1(X,A)$ is $H^1(X,\mathcal{M}^\times)$ which is known to be trivial!

**What is going on here?** Perhaps this is near the correct analogy, or this is nowhere close. It seems however like the adelic kernel formulations remain a complete mystery, and the dictionary resolves nothing about it.

Below I give a more detailed explanation of the above dictionary.

-----------

Consider $X=\Spec(\mathcal{O}_K)$. Let $j$ be the inclusion of the generic point, and $i_p$ be the inclusion of a closed point $\Spec(\mathbb{Z}/p\mathbb{Z})$. Consider the following short exact sequence of abelian sheaves in the smooth topology:

$$1\rightarrow\mathbb{G}_m\rightarrow j_\ast\bar{K}^\times\rightarrow\bigoplus_{p\in\lvert X\rvert}i_{p\ast}\mathbb{Z}\rightarrow 1.$$

Taking sheaf cohomology, we find that $H^1(X,j_\ast\bar{K}^\times) = H^1(\Spec(K),\bar{K}^\times)$ which vanishes by Theorem 90; hence we get the following exact sequence used as the basis of Kailasa's proof:

$$1\rightarrow\mathcal{O}_K^\times\rightarrow K^\times\rightarrow \DeclareMathOperator\Div{Div}\Div(X)\rightarrow H^1(X,\mathbb{G}_m)\rightarrow 1$$ 

where $\Div(X)$ is the group of fractional divisors on $\mathcal{O}_K$. In other words, $\Cl(K)=H^1(X,\mathbb{G}_m)$, the Picard group of the scheme. This is a well-known relationship.

Less well-known is the analogue for a Néron model; given the Néron model $A$ of some abelian variety on $K$, the sheaf $A(U)=\operatorname{Hom}_X(U, A)$ on the smooth topology of $X$ satisfies $j_* E(\bar{K})\cong A$ (as an abelian sheaf). 

We can construct a smooth subgroup-scheme $A^0$ of $A$; the construction can be found in [Mazur's paper][4] (page 200). He also describes the following short exact sequence of sheaves:

$$1\rightarrow A^0\rightarrow j_*E(\bar{K})\rightarrow\bigoplus_{p\in|X|}i_{p^*}F_p\rightarrow 1$$

where $F_p$ refers to a particular $\mathbb{Z}/p\mathbb{Z}$-module having to do with the construction of $A$. 

----------

**Update! The Class group measures an algebraic number theory local-global principle. Skip anything below this point if you just want the question; this is just results.**

After some study, I've concluded that Kailasa's proof revolves around two lemmas from ANT. The first is this:

*Lemma.* Every fractional ideal $I$ of $\mathcal{O}_K$ satisfies $I\mathcal{O}_{K_\nu}=\alpha\mathcal{O}_{K_\nu}$ for some $\alpha\in\mathcal{O}_{K_\nu}$, for each finite place $\nu$.

The above lemma is essentially a direct consequence of Chinese remainder theorem; for any $I$ and $\nu$, there is $p\in K$ such that $pI$ is coprime to $\nu$, in which case $pI$ becomes principal in $\mathcal{O}_{K_\nu}$, so you can just divide by the image of $p$. 

The second lemma is an *algebraic* local-global principle:

For a principal ideal $\alpha\mathcal{O}_L$, $L/K$ finite, the following are equivalent:

1. For each finite place $\nu$ of $K$, we have $\alpha\mathcal{O}_{L_{\nu'}}=\beta\mathcal{O}_{L_{\nu'}}$ for some $\beta\in\mathcal{O}_{K_\nu}$ and place $\nu'$ of $L$ lying over $\nu$, and  
2. There is a *fractional ideal* $I\in\text{Div}(\mathcal{O}_K)$ with $I\mathcal{O}_L=\alpha\mathcal{O}_L$.

If the class group of $K$ vanishes, then this becomes a much stronger algebraic local-global principle, as the following are equivalent:

1. For each finite place $\nu$ of $K$, the embedding of $\alpha$ in $\mathcal{O}_{L_{\nu'}}$ differs by a unit from $\beta\in\mathcal{O}_{L_{\nu'}}$, and
2. $\alpha$ differs by a unit from some $\beta\in K$.

So indeed, if the class group vanishes, we can reconstruct an element of $L$ as an element of $K$ (up to units), provided we can reconstruct it as an element of $K_\nu$ for every $\nu$ (up to units).

On the other hand, if the class group does not vanish then taking any non-principal ideal $I$, there is some finite $L/K$ in which $I\mathcal{O}_L$ is principal; then, $I\mathcal{O}_L$ can be reconstructed as a principal ideal at every finite place of $K$ by Lemma 1.

The *weak* algebraic local-global principle, which holds for any $K$, is precisely what is needed to show that $Ш(K)\subset Cl(K)$. Then Lemma 1 is precisely what is needed to show that $Cl(K)\subset Ш(K)$. 

-----------

**What is the significance of this?** The algebraic local-global principle gives more reason to view the class group specifically as a way to measure the failure of a local-global principle on $\mathcal{O}_\bar{K}^\times$. Let's be a bit more explicit in the analogy with elliptic curves:

1. $\mathcal{O}_{-}^\times$ is like an abelian variety defined over $\mathbb{Q}$.
2. Principal homogeneous spaces for $\mathcal{O}_{-}^\times$ are (nonzero) algebraic numbers $x$.
3. For a principal homogeneous space $x$ of $\mathcal{O}_{-}^\times$, $x(K)$ is the subset of $\mathcal{O}_\bar{K}^\times$ consisting of $u$ such that $\frac{x}{u}\in K$. Members of $x(K)$ are *$K$-rational points.*
4. $x(K_\nu)$ is then the subset of $\mathcal{O}_{\bar{K}_\nu}^\times$ consisting of $u$ such that $\frac{x_\nu}{u}\in K_\nu$, where $x_\nu$ is the image of $x$ along some chosen embedding $\bar{K}\rightarrow\bar{K}_\nu$.

Then, a non-trivial element of $Ш(\mathcal{O}_{-}^\times/K)$ is just a homogeneous space $x$ of $\mathcal{O}_{-}^\times$ which has a $K_\nu$-rational point for every $\nu$, but no $K$-rational point.

Notably, this dictionary also makes it possible to view that, for example, $\mathcal{O}_{\mathbb{C}}^\times=\mathbb{T}$, so $x(\mathbb{R})$ is the subset of complex numbers $u$ in the unit circle such that $\frac{x}{u}\in\mathbb{R}$. However, any algebraic number $x$ then has $\frac{x}{|x|}=u$ in the unit circle, so then $u$ is a real point. This therefore becomes trivial in the calculation of the group.

While this dictionary does provide us exact analogy with abelian varieties, there are some senses in which it may be incomplete. More studies are required!
  
  [1]: https://math.uchicago.edu/~may/REU2016/REUPapers/Kailasa.pdf
  [2]: https://math.stackexchange.com/questions/80509/how-are-the-tate-shafarevich-group-and-class-group-supposed-to-be-cognates
  [3]: https://www.ma.imperial.ac.uk/~buzzard/maths/research/notes/why_is_an_ideal_class_group_a_tate_schaferevich_group.pdf
  [4]: https://link.springer.com/article/10.1007/BF01389815