I am curious what goes wrong with this invariant theoretic argument of Dirichlet's Theorem of primes in arithmetic progression. I know that something goes wrong, but I am really curious about what the proverbial "fly in the ointment" is.
Here is the argument.
Let $ S $ be the set of primes $ p $ such that $ p \not \equiv a \mod{n} $, and let $ p_{i} $ be the $ i $-th element of $ S $. Define an action $ \beta $ of $ \mathbb{G}_{m} $ on $ \mathbb{A}^{N^{2}}_{\mathbb{C}} $ as follows. If the affine coordinate ring of $ \mathbb{A}^{N^{2}}_{\mathbb{C}} $ is $ \mathbb{C}[x_{i,j}] $ where $ 1 \le i,j \le N $ and the affine coordinate ring of $ \mathbb{G}_{m} $ is $ \mathbb{C}[z]_{z} $, then let $ \beta^{\sharp}(x_{i,j})= z^{p_{i}-nj-a+1} x_{i,j} $. An element $ x_{i,j} $ is a character of order one if and only if $ p_{i} =nj+a $.
Next we prove that the following three statements are equivalent. The first statement is (1): the variety $ D(f(X)) $ is a trivial $ \mathbb{G}_{m} $-bundle, and $ \mathbb{G}_{m} $ acts freely on $ \mathbb{A}^{N^{2}}_{\mathbb{C}} $. The second statement is (2): there is a $ \mathbb{G}_{m} $-equivariant morphism $ \Phi: D(f(X)) \to \mathbb{G}_{m} $ and $ \mathbb{G}_{m} $ acts freely on $ \mathbb{A}^{N^{2}}_{\mathbb{C}} $. The third statement is (3): there is a character $ g(X)/h(X) $ of order one, such that $ g(X) $ and $ h(X) $ have no common factor and all common factors of $ g(X) $ and $ h(X) $ are factors of $ f(X) $.
If (1) is true, then there is a $ \mathbb{G}_{m} $-equivariant isomorphism $ \lambda: D(f(X)) \to Y \times \mathbb{G}_{m} $ for a sub-variety $ Y $. If $ p_{2} $ is the projection from $ Y \times \mathbb{G}_{m} \to \mathbb{G}_{m} $, then $ p_{2} \circ \lambda $ is the desired morphism $ \Phi: D(f(X)) \to \mathbb{G}_{m} $. Therefore (1) implies (2).
If (2) holds, then let $ Y $ be the scheme theoretic pre-image of the identity with its reduced induced scheme structure. The scheme $ Y $ is a variety. Define a morphism $ \lambda: D(f(X)) \to Y \times \mathbb{G}_{m} $ via the morphism which sends $ x $ to $ (\Phi(x)^{-1} \ast x, \Phi(x)) $. The morphism $ \lambda $ has an inverse, namely the one which sends $ (y,t) $ to $ t \ast y $. We do not have to worry about issues with separability, so $ \lambda $ is an isomorphism which shows that (2) implies (1).
If (2) holds, then $ \Phi^{\sharp}(z) $ is equal to $ g(X)/h(X) $ where $ g(X)/h(X) $ is a unit in $ D(f(X)) $ and $ g(X), h(X) $ have no common factors. As a result, all factors of $ g(X) $ and $ h(X) $ are factors of $ f(X) $. Because $ \Phi $ is $ \mathbb{G}_{m} $-equivariant, if $ \mu_{\mathbb{G}_{m}} $ is the multiplication morphism of $ \mathbb{G}_{m} $ then the following computations show that $ g(X)/h(X) $ is a character of order one: \begin{align*} zg(X)/h(X)&= (\Phi^{\sharp} \otimes \operatorname{id}_{\mathbb{C}[z]_{z}})(z \otimes z) \\ &= (\Phi^{\sharp} \otimes \operatorname{id}_{\mathbb{C}[z]_{z}}) \circ \mu_{\mathbb{G}_{m}}^{\sharp}(z) \\ &= \beta^{\sharp} \circ \Phi^{\sharp}(z) \\ &= \beta^{\sharp}(g(X)/h(X)). \end{align*} As a result (2) implies (3).
If $ g(X), h(X) $ fulfill the requirements of (3), then let $ \Phi^{\sharp}(z) $ equal $ g(X)/h(X) $. The ring homomorphism $ \Phi^{\sharp} $ determines a morphism $ \Phi: D(f(X)) \to D(z) \subseteq \operatorname{Spec}(\mathbb{C}[z]) $. The following computations show that it is $ \mathbb{G}_{m} $-equivariant, \begin{align*} \beta^{\sharp} \circ \Phi^{\sharp}(z) &= \beta^{\sharp}(g(X)/h(X))\\ &= z g(X)/h(X) \\ &= (\Phi^{\sharp} \otimes \operatorname{id}_{\mathbb{C}[z]_{z}})(z \otimes z) \\ &= (\Phi^{\sharp} \otimes \operatorname{id}_{\mathbb{C}[z]_{z}}) \circ \mu_{\mathbb{G}_{m}}^{\sharp}(z). \end{align*} As a result, (3) implies (2).
Let us assume that $ N $ is large enough so that there are at least four indeterminates $ x_{i,j} $ such that $ (i_{1},j_{1}), (i_{2},j_{2}), (i_{3},j_{3}), (i_{4},j_{4}) $ are distinct ordered pairs, $ \gcd(p_{i_{1}}-nj_{1}-a+1, p_{i_{2}}-nj_{2}-a+1)=1 $ and $ \gcd(p_{i_{3}}-nj_{3}-a+1, p_{i_{4}}-nj_{4}-a+1)=1 $.
Let $ V_{1} $ be the open sub-variety $ D(x_{i_{1},j_{1}}x_{i_{2},j_{2}}) $ and $ V_{2} $ be the open sub-variety $ D(x_{i_{3},j_{3}}x_{i_{4},j_{4}}) $. Without loss of generality there are natural numbers $ a_{1},b_{1} $ such that if $ f_{1}(X) $ is equal to $ x_{i_{1},j_{1}}^{a_{1}}/x_{i_{2},j_{2}}^{b_{1}} $, then $ f_{1}(X) $ is a character of order one on $ V_{1} $. Likewise, there are natural numbers $ a_{2},b_{2} $ such that if $ f_{2}(X) $ is equal to $ x_{i_{3},j_{3}}^{a_{2}}/x_{i_{4},j_{4}}^{b_{2}} $, then $ f_{2}(X) $ is a character of order one on $ V_{2} $.
If $ u(X) $ is equal to $ f_{2}(X)/f_{1}(X) $, then $ u(X) $ is a unit on $ V_{1} \cap V_{2} $. As a result, the endomorphism of the affine coordinate ring of $ V_{1} \cap V_{2} $ which multiplies a function by $ u(X) $ is an isomorphism of the affine coordinate ring of $ V_{1} \cap V_{2} $. Therefore we obtain an isomorphism of the affine variety $ V_{1} \cap V_{2} $, which we shall denote by $ u(X)^{\ast} $.
If $ \iota_{1}: V_{1} \cap V_{2} \to V_{1} $ (respectively $ \iota_{2}: V_{1} \cap V_{2} \to V_{2} $) is the typical embedding of $ V_{1} \cap V_{2} $ into $ V_{1} $ (respectively $ V_{2} $), then embed $ V_{1} \cap V_{2} $ into $ V_{1} $ via $ \iota_{1} \circ u(X)^{\ast} $ and $ V_{1} \cap V_{2} $ into $ V_{2} $ via $ \iota_{2} $. With these embeddings it is possible to glue $ V_{1} \cup V_{2} $ into a variety which is isomorphic to the typical scheme theoretic union of $ V_{1} $ and $ V_{2} $.
Now if $ \Phi_{1}: V_{1} \to \mathbb{G}_{m} $ is the $ \mathbb{G}_{m} $-equivariant morphism which is obtained from the ring homomorphism which sends $ z $ to $ f_{1}(X) $ and $ \Phi_{2}: V_{2} \to \mathbb{G}_{m} $ is the $ \mathbb{G}_{m} $-equivariant morphism which is obtained from the ring homomorphism which sends $ z $ to $ f_{2}(X) $, then $ \Phi_{1} $ and $ \Phi_{2} $ glue together to form a morphism $ \Phi: V_{1} \cup V_{2} \to \mathbb{G}_{m} $. If $ \Phi^{\sharp} $ is the corresponding ring homomorphism, then $ \Phi^{\sharp}(z) \in k[x_{i,j}]_{1 \le i,j \le N} $. From (3) with respect to $ \mathbb{A}^{N^{2}}_{\mathbb{C}} $ as a whole, we know that if $ \Phi^{\sharp}(z) $ is equal to $ f(X) $, then $ f(X) $ is a character of order one.
If $ f(X) $ is a polynomial which is a character of order one, then each monomial must be a character of order one. If $ X^{J} $ is a monomial, which is a character of order one, then there is a unique indeterminate $ x_{i,j} $ dividing $ X^{J} $ which is a character of order one. A linear indeterminate $ x_{i,j} $ is a character of order one if and only if $ p_{i}=nj+a $, which implies that the set of primes congruent to $ a $ modulo $ n $ is infinite.
This argument is too good to be true because for any function $ f(x_{1},\dots,x_{n}): \mathbb{Z}^{n} \to \mathbb{Z} $ this argument says that if there are four distinct values $ (X_{1},X_{2},X_{3},X_{4}) $ such that $ \gcd(f(X_{1}), f(X_{2}))=1 $ and $ \gcd(f(X_{3}),f(X_{4}))=1 $, then there are infinitely many tuples $ X_{i} $ such that $ f(X_{i}) $ is equal to one. This clearly cannot hold, so there is something wrong with this argument. What is it?