nth neighbourhood of the diagonal I need the following lemma from commutative algebra for algebraic geometry, and I do not know how to prove it.
Lemma. Let $A$ be a $k$-algebra. Let $I$ be the kernel of the ring map $A\otimes_kA\to A$ which sends $a\otimes b$ to $ab$. Let $x^*$ and $y^*$ be two $k$-algebra maps $A\to S$. The induced morphism $A\otimes_kA\to S, a\otimes b\mapsto x^*(a)\, y^*(b)$ kills the ideal $I^{n+1}$ if and only if the following condition holds:

For each morphism $g^*:S\to T$ of $k$-algebras and elements $t_j\in T$, $a_j\in A$ it holds that $$\left(\sum_jt_j \,g^*(x^* - y^*)(a_j)\right)^{n+1}=0$$

Is it true? I can't even do the case $n=2$.
Background. Given an a $k$-algebra $A$, one can define the $n$th neighbourhood of the diagonal $\Delta_{A/k}$. One gets $$Spec (A\otimes_kA/I)\to Spec (A\otimes_kA/I^{n+1})\to Spec (A\otimes_kA)$$
and the sequence of $k$-schemes has a universal property with respect to $n$order thickenings of $k$-schemes. On the other hand, in synthetic differential geometry the $n$th order neighbourhood of the diagonal of an affine space is defined through the following sequent. $$Zar(k)\models
\forall
x,y:Spec A. (x\sim_ny \leftrightarrow \forall f:(\mathbb A_k)^{Spec A}. (f(x)-f(y))^{n+1} = 0)$$
I like to show that the subobjets of $Spec A\times_kSpec A$ are the same (Anders Kock claims that this is the case for affine schemes), and by translating the sequent with help of the forcing semantic I ended up with the algebraic statement above.
Edit. To make sure that I didn't do a translation mistake, I will include the process here step by step. I use the forcing semantic which is explained on the fourth page of this paper.
I like to know under which conditions two generalised points $x,y:Spec\, S\to Spec\, A$ in $Zar(k)$ satisfy that their pair $(x,y):Spec \,S\to Spec \,A\times Spec\, A$ factors through $\sim_n$. According to the forcing sematic (and in the notation of the paper) this is the case if and only if $$Spec \, S \models_{[x:Spec\, A,y:Spec\,A]}\forall
f: (\mathbb A_k)^{Spec\, A}. (f(x) - f(y))^{n+1} =0 \quad[x,y]$$
holds. I am kind of reluctant to introduce to many new names, but the first four occurrences of $x$ and $y$ in the sequent above are just variables in the formal language, while the last two are actual morphisms which are meant to be inserted for $x$ and $y$ later. Next I need to remove the for all quantifier. The sequent above holds if and only if for any map $g:Spec \, T\to Spec \, S$ and $f:Spec\, T\to (\mathbb A_k)^{Spec\, A}$ we have that the following is true.
$$Spec \, T \models_{[x:Spec\, A,y:Spec\,A, f:(\mathbb A_k)^{Spec\, A}]} (f(x) - f(y))^{n+1} =0 \quad[xg,yg, f]$$
Now I need to interpret the terms. The interpretation of $f(x)$ is the composite$$Spec\, T \xrightarrow{(f,xg)} \mathbb A_k^{Spec\,A}\times Spec\, A \xrightarrow{ev}\mathbb A_k$$
Similar for $f(y)$. To turn it into algebra I have to remove the exponential object. Morphisms $f:Spec\, T\to \mathbb A_k^{Spec\, A}$ are in bijection with morphisms $\overline f :Spec \, T\times Spec \,A\to \mathbb A_k$, and under the correspondence the map above becomes $$Spec \, T\xrightarrow{(id,xg)} Spec\, T \times Spec \, A\xrightarrow{\overline f}\mathbb A_k$$. Thus I get the following result, which I like to show.
Proposition. Let $I$ again be the ideal of $A\otimes_kA$ which defines the diagonal of $Spec\,A$. Given two morphisms $x,y:Spec \, S\to Spec\, A$ of affine $k$-schemes, I like to show that the pair $(x,y)$ factors through $Spec(A\otimes_kA/I^{n+1})\hookrightarrow Spec (A\otimes_kA) = Spec\, A\times Spec \, A$ if and only if for each maps $g:Spec\, T\to Spec\, S$ and $f: Spec\, T\times Spec A\to \mathbb A_k$ of affine $k$-schemes we have that $$f\circ (id,x g) - f\circ(id,yg):Spec\, T\to \mathbb A_k$$
is zero to the power of $n+1$.
If I translate that fully into algebra, then I end up with the lemma at the beginning of the question.
Edit, edit. The first version of the question contained the following lemma (which was unfortunately an incorrect translation) and the accepted answer below is about that lemma.

Lemma. Let $A$ be a $k$-algebra. Let $I$ be the kernel of the ring map $A\otimes_kA\to A$ which sends $a\otimes b$ to $ab$. Let $\phi$ and $\psi$ be two $k$-algebra maps $A\to S$. Then the induced morphism $A\otimes_kA\to S, a\otimes b\mapsto \phi(a) \psi(b)$ kills the ideal $I^{n+1}$ if and only if it holds that $$(\sum_i a_i\phi(b_i) - a_i\psi(b_i))^{n+1} = 0$$for each element $\sum_i a_i\otimes b_i$ of the ring $A\otimes_kA$.

 A: So, a definite answer: with a suitable tweak (accounting for the fact that there is no natural $A$-structure on $S$), it should be yes in characteristic zero, but it is false in positive characteristic. More precisely, if $(n+1)!$ is invertible in $k$, then the statement holds.

The counter-example first: let $p$ be a prime number, $S=\mathbb{F}_p[x,y,z]/(x^p,y^p,z^p)$. Note that $S$ is local Artinian and every non-invertible element has nilpotency order at most $p$.
Take $A=\mathbb{F}_p[s,t]$, $\phi: (s,t)\longmapsto (x,y)$, $\psi: (s,t) \longmapsto (y,z)$. The kernel of multiplication $I$ is generated by $s_1=s\otimes 1-1 \otimes s$, $t_1=t\otimes 1-1\otimes t$.
Note that $\phi-\psi$ always takes non-invertible values, so that “your condition” holds.
But $(\phi \otimes \psi)(s_1t_1)=(x-y)(y-z) \neq 0$, so that $\phi \otimes \psi$ doesn’t kill $I^2$.

Now for the positive result. First, $I^{n+1}$ is the ideal generated by the products of $(n+1)$ elements of $I$ – we can even say: the products of any $n+1$ elements among a system of generators for $I$. Note that $I$ is generated by the $a\otimes 1-1\otimes a$.
So $\phi \otimes \psi$ kills $I^{n+1}$ iff for every $a_1,\ldots,a_{n+1} \in A$, $\prod_{i=1}^{n+1}{\phi\otimes\psi(a_i\otimes 1-1\otimes a_i)}=0$, ie iff $\prod_{i=1}^{n+1}{(\phi-\psi)(a_i)}=0$.
This obviously implies “your condition”.
Now assume that something slightly stronger than your condition is verified: we have $\left(\sum_i{a_i(\phi-\psi)(b_i)}\right)^{n+1}=0$ for all $a_i \in S$, $b_i \in A\otimes A$ (this is still implied by the fact that $\phi \otimes \psi$ kills $I^{n+1}$).
Let $J$ be the ideal of $S$ generated by the image of $\phi-\psi$. Then $\phi \otimes \psi$ kills $I^{n+1}$ iff $J^{n+1}=0$, but the above condition is equivalent to $z ^{n+1}=0$ for all $z \in J$. We conclude (provided that $(n+1)! \in k^{\times}$) with the following lemma.
Lemma: let $I$ be an ideal of a ring $R$ and $n \geq 1$. If $n!$ is invertible in $R$, then $I^n$ is generated by the $i^n$ for $i \in I$.
Proof: induction over $n$. The case $n=1$ is trivial. Assume $n\geq 2$ and the statement holds up for integers $k \leq n-1$. Let $J_n$ be the ideal generated by the $n$-th powers of elements of $I$.
Let $u \in I$, let $I’=\{t \in R,\, tu \in J_n\}$, then it is enough to show that $I’$ contains $nx^{n-1}$ for each $x \in I$: since $I’$ is an ideal, the induction hypothesis means it then contains $I^{n-1}$, so $uI^{n-1}$ is contained in $J_n$ for all $u \in I$, so that $I^n \subset J_n$.
Now, let $x \in I$, and let, for every integer $q$, $P(q)=\frac{(x+qu)^n-x^n}{q} \in R$ (with the suitable extension at $0$). Now $P$ satisfies a good linear recurrence relation, $P$ has degree $\leq n-1$, and $P(q) \in J_n$ for $1 \leq q \leq n$), so that $P(0)=nx^{n-1}u \in J_n$, so that $nx^{n-1} \in I’$.
A: I have found out why the algebra did not work out the way I liked it to. The $n$th neighbourhood of an $S$-scheme $X$ should not be defined by testing it against maps $X\to \mathbb A_S$, but by testing it against maps $X\to \mathbb A^r_S$ for arbitrary $r$. What I was looking for is the following statement.
Proposition. Let $X$ be an $S$-scheme and let $\Delta_{X/S}^n$ be the $n$-th order infinitesimal thickening of the diagonal $\Delta_{X/S}$. Let $T$ be an arbitrary $S$-scheme, and let $x_0,x_1:T\to X$ be two test maps of $S$-schemes. Then the following are equivalent.

*

*The pair $(x_0,x_1)$ lies in $\Delta_{X/S}^n$.

*The two morphisms $x_0$ and $x_1$ agree on all field valued points, and whenever  $U$ is open in $X$, $r$ is a natural number, and $(f_1,...,f_r):U\to\mathbb A_S^r$ is a morphism, then $(f_1,...,f_r)\circ x_0 - (f_1,...,f_r)\circ x_1$ lies in $D_S(r,n)=Spec \, \mathbb Z[x_1,...,x_r]/(x_1,...,x_r)^{n+1}\times S \subset
\mathbb A_S^r$.

The corresponding algebra statement is the following lemma.
Lemma. Let $A$ be a $k$-algebra (where $k$ is any ring) and let $I$ be the kernel of the multiplication map. Let $x_0,x_1:A\to B$ be two $k$-algebra maps. Then $a_0\otimes a_1\mapsto x_0(a_0)x_1(a_1)$ kills $I^{n+1}$ if and only if $x_0 y = x_1 y$ whenever $y:C\to K$ is a morphism into a field, and $$\prod_{i=1}^{n+1}(x_0(a_i)-x_1(a_i))=0$$for arbitrary elements $a_1,...,a_{n+1}$ of $A$.
