We may assume from the outset that

\(p \in J\text{.}\) Suppose first that

\(S\) admits an action by a finite group

\(G\) such that

\(R \to S\) is a

\(J\)-almost

\(G\)-Galois cover. Note that this hypothesis is preserved by a

\(p\)-completely flat base extension, as it can be checked modulo

\(p\) thanks to derived Nakayama (

Remark 6.6.6); moreover, all of the conclusions can also be checked after such a base extension. By

Theorem 19.4.4, we may thus assume that

\(R\) is absolutely integrally closed. By

Lemma 19.4.2, we can then find generators

\(f_1,\dots,f_r\) of

\(J\) such that

\(R \to S\) splits outside

\(V(f_i)\) for

\(i=1,\dots,r\text{.}\) Since being a

\(J\)-almost isomorphism is equivalent to being an

\((f_i)\)-almost isomorphism for

\(i=1,\dots,r\text{,}\) we may reduce to the case where

\(J = (f)\) and we have an

\(R\)-algebra isomorphism

\(S[f^{-1}] \cong \prod_{i \in I} R[f^{-1}]\) for some finite index set

\(I\text{.}\) Put

\(S' = \prod_{i \in I} R\) and let

\(S'\) be the integral closure of

\(R\) in

\(S[f^{-1}]\text{;}\) we then have maps

\(S \to S'', S' \to S''\) to which we may apply

Corollary 25.2.5. This allows us to equate all of the desired assertions about

\(S\) to the corresponding statements about

\(S'\text{,}\) which are self-evident.

Now consider the general case. In this case,

\(\Spec(R) \setminus V(J)\) can be partitioned as a finite union

\(\bigsqcup_i U_i\) of closed-open subsets, on each of which the degree of

\(\Spec(S) \to \Spec(R)\) is constant. For each

\(i\text{,}\) let

\(R_i\) be the image of

\(R\) in

\(H^0(U_i, \calO)\) and let

\(R_{i,\lens}\) be the lens coperfection of

\(R_i\text{.}\) The map

\(R \to \prod_i R_{i,\lens}\) satisfies the condition of

Lemma 25.2.2, so we may reduce to the previous case.