When is the character group scheme of a group scheme representable? (Affine Case)

While reading Tate's article on Finite Flat Group Schemes in "Modular Forms and Fermat's Last Theorem" I was lead to this question. Let $S$ be a scheme, $G$ a group scheme over $S$, and $T$ an $S$-scheme. The character group scheme of $G$ (denoted $G^{\prime}$) is the functor, $$T\mapsto Hom_{(Gr/T)}(G_T,(\mathbb{G}_m)_T)$$ from the category of $S$-schemes to that of Abelian Groups. By "$Hom_{(Gr/T)}(G_T,(\mathbb{G}_m)_T)$" I mean the hom set in the category of group schemes over $T$.

Question: Suppose that $G$ and $S$ are affine. What additional conditions do I need in order to ensure that $G^{\prime}$ is representable?

What I have so far: Let $G=Spec(A),S=Spec(R),T=Spec(B)$, where $A$ is a commutative, unital Hopf $R$-algebra, and $B$ is an $R$-algebra. I know that there is a $$G^{\prime}(T)=Hom_{(Gr/T)}(G_T,(\mathbb{G}_M)_T)\xrightarrow{natural}Hom_{(Gr)}(G(T),\mathbb{G}_m(T)),$$ given as follows: A given $\phi\in G^{\prime}(T)$ induces the group homomorphism that takes each $g\in G(T)$ to $$T\xrightarrow{g_T}G_T\xrightarrow{\phi}(\mathbb{G}_M)_T\xrightarrow{projection}\mathbb{G}_m.$$

I also know that $G^{\prime}(T)$ consists of the group-like elements of $A\otimes_RB$. That is, units, $u$, such that $m_B(u)=\Delta(u)$, where $m_B:A\otimes_RB\rightarrow (A\otimes_RB)\otimes_B(A\otimes_RB)$ is the comultiplication and $\Delta$ is the codiagonal ($u\mapsto u\otimes u$).

I've played around with taking the kernel of $m_B-\Delta$, since it is $B$-linear. I've tried using the adjunction between hom and tensor product. I've tried doodling around with Yoneda's Lemma. I expect that the representing object for $G^{\prime}$ should be some sort of fibered product of schemes, but I'm stuck in finding it. Oh, and I expect that $G^{\prime}$ is representable when $A$ is free over $R$, but I don't know how to show it, and I was hoping to weaken that hypothesis a little.

• I should expect trouble if $G$ is not commutative, or if I leave the finite flat case.
• In the case that $G$ is commutative the term you want to look up is "Cartier duality." – Qiaochu Yuan Feb 22 '17 at 4:50
• If $G$ is not commutative, you may want to examine its abelianization. – S. Carnahan Feb 22 '17 at 5:17
• If $G$ is quasi-finite, yet not finite (i.e., if you try to weaken too much your hypothesis that $A$ is a finite free $R$-module), then this is not representable. Begin with $\overline{G}$, the finite, etale group scheme over $S$ whose sections over every connected open is the group $\mathbb{Z}/2\mathbb{Z}$. Now, for one closed point $s\in S$, remove the nontrivial element of the fiber of $\overline{G}$ over $s$ to obtain $G$. The sections of $G'$ on open neighborhoods of $s$ are again $\mu_2$, just as for $\overline{G}'$. However, $G'$ is trivial on all infinitesimal neighborhoods of $s$. – Jason Starr Feb 22 '17 at 5:23
• If $G=\mathbb{G}_a$, then $A=R[x]$ is free over $R$, but $G'$ is not representable. – Laurent Moret-Bailly Feb 22 '17 at 9:56