Matrix performing local differintegral analysis being its own inverse. Coincidence? I found a curious matrix
$$T = \begin{bmatrix}1&2&1\\1&0&-1\\1&-2&1\end{bmatrix}$$
This matrix (or actually $\frac 1 2 T$) performs


*

*Local mean value (integral) estimation.

*Local derivative estimation by central midpoint distance.

*Local second order derivative by midpoint (but half step length compared to 2).


Yet if we calculate its inverse, we find:
$$T^{-1} = \frac 1 4 T$$
or maybe more interesting:
$$\left(\frac 1 2 T\right)^{-1}=\frac 1 2 T$$
Matrix and inverse are the same!
Is this a coincidence? Or what properties or choices of estimators will give us this curious behavior? Is this a property of differential and integral operators in general or just because of some specific choice of how to estimate them?
 A: Alas, I should have done more searching at the start before deriving an answer from scratch!
It turns out this has already been investigated.
For an arbitrary dimension, these are known as Kravchuk polynomials.
Its involutory properties such as $$\left(K^{(n+1)}\right)^2=2^nI$$ can be found and proved in for instance, Feinsilver and Shott (2010): On Krawtchouk Transforms.

Original Answer
This is a collaborative effort with @MykolaPochekai. We generalise the matrix $T$ to an arbitrary dimension.
We begin by defining the $(n+1)\times(n+1)$ dimensional matrix $T^{(n+1)}$ whose elements satisfy the following constraints\begin{align}T^{(n+1)}_{i,0}=1,&\quad T^{(n+1)}_{i,n}=(-1)^i&\quad\forall0\le i\le n\\T^{(n+1)}_{0,j}={n\choose j},&\quad T^{(n+1)}_{n,j}=(-1)^i{n\choose j}&\quad\forall0\le j\le n\\T^{(n+1)}_{i,j}+T^{(n+1)}_{i+1,j}&=2T^{(n)}_{i,j}&\quad\forall0<i,j<n\end{align} for each $n>1$. We use the convention that $\binom ab=0$ whenever $b>a$. The last constraint can be interpreted as approximating a local $n$th-order derivative by midpoint.

Theorem 1. For each $n>1$, the matrix $2^{-n/2}T^{(n+1)}$ is an involution.

The method of proof is as follows

*

*deriving a closed form for each entry of $T^{(n+1)}$ (Lemma 2)


*showing that all off-diagonal entries of $(T^{(n+1)})^2$ are zero (Proposition 5)


*showing that all main diagonal entries of $(T^{(n+1)})^2$ equal $2^n$ (Proposition 6).

Using a bivariate generating function, it is possible to derive a closed form for an arbitrary element $T^{(n+1)}_{i,j}$.
Lemma 2. For every $0<i,j<n$, $$T^{(n+1)}_{i,j}=(-1)^i\sum_{k=0}^i\binom ik\binom{n-k}j(-2)^k.$$
Proof. As the algebra is rather tedious, we provide a very brief sketch; further details can be found in this MSE answer. Define $$f(x,y)=\sum_{n\ge1}\sum_{i=0}^nT^{(n+1)}_{i,j}x^{n-1}y^i$$ where the indices are chosen so that the terms disappear in the base index. Applying the double summation to the recurrence relation $T^{(n+1)}_{i,j}+T^{(n+1)}_{i+1,j}=2T^{(n)}_{i,j}$ yields $$(2xy-y-1)f(x,y)=\sum_{n\ge1}\binom njx^{n-1}=\frac{x^{j-1}}{(1-x)^{j+1}}$$ after significant simplification. To extract the coefficient $[x^{n-1}y^i]$, we expand the denominator into two power series \begin{align}f(x,y)&=x^{j-1}\sum_{m\ge0}\binom{m+j}jx^m\cdot\sum_{\ell\ge0}(2x-1)^\ell y^\ell\end{align} so that \begin{align}T^{(n+1)}_{i,j}&=[x^{n-j}]\sum_{m\ge0}\binom{m+j}jx^m\cdot\sum_{k=0}^i\binom ik2^kx^k(-1)^{i-k}.\end{align} Taking $m+k=n-j$ gives us the desired result. $\quad\square$
Remark 3. There appears to be a circular, hyperbolic pattern. I have asked about it here.
Corollary 4. $T^{(n+1)}$ anti-diagonalises the matrix $$P=\begin{pmatrix}1&&&&\\&-1&&&\\&&1&&\\&&&-1&\\&&&&\ddots\\&&&&(-1)^n\end{pmatrix}.$$ In particular, we have $T^{(n+1)}J_{n+1}\left(T^{(n+1)}\right)^{-1}=P$ where $J_{n+1}$ is an exchange matrix.
Proposition 5. For all $0\le i,j\le n$, we have $T^{(n+1)}_{i,j}=(-1)^iT^{(n+1)}_{i,n-j}$ (rows) and $T^{(n+1)}_{i,j}=(-1)^jT^{(n+1)}_{n-i,j}$ (columns). Consequently, due to symmetry of rows and columns, it follows that $(T^{(n+1)})^2_{i,j}=\sum\limits_{r=0}^nT^{(n+1)}_{i,r}T^{(n+1)}_{r,j}$ becomes zero for all $i\ne j$.
Proof. From Lemma 2, we write the second binomial coefficient using the coefficient operator. This gives the following direct proof. \begin{align}T^{(n+1)}_{i,n-j}&=\sum_{k=0}^i\binom ik[x^{n-j}](x+1)^{n-k}(-2)^k\\&=[x^{n-j}](x+1)^n\sum_{k=0}^i\binom ik\left(-\frac2{x+1}\right)^k=[x^{n-j}](x+1)^n\left(\frac{x-1}{x+1}\right)^i\\&=[x^{-j}]\left(1+\frac1x\right)^n\left(\frac{1-1/x}{1+1/x}\right)^i\\&=[x^j](1+x)^n\left(\frac{1-x}{1+x}\right)^i=[x^j](1+x)^n(-1)^i\sum_{k=0}^i\binom ik\left(-\frac2{1+x}\right)^k\\&=(-1)^i\sum_{k=0}^i\binom ik[x^j](1+x)^{n-k}(-2)^k\\&=(-1)^iT^{(n+1)}_{i,j}.\end{align} Similarly, proving $T^{(n+1)}_{i,j}=(-1)^jT^{(n+1)}_{n-i,j}$ is equivalent to showing that $$[x^j](x+1)^i(x-1)^{n-i}=(-1)^j[x^j](x+1)^{n-i}(x-1)^i$$ which can be verified by direct comparison. $\quad\square$
Proposition 6. For all $0\le i\le n$, we have $(T^{(n+1)})^2_{i,i}=2^n$.
Proof. By definition, \begin{align}(T^{(n+1)})^2_{i,i}&=\sum\limits_{r=0}^nT^{(n+1)}_{i,r}T^{(n+1)}_{r,i}\\&=\sum_{r=0}^n\sum_{k=0}^i\sum_{\ell=0}^r(-1)^{i+r}(-2)^{k+\ell}\binom ik\binom r\ell\binom{n-k}r\binom{n-\ell}i.\end{align} In Combinatorial identity: $2^N=\sum_{m=0}^N\sum_{r=0}^n\sum_{s=0}^m(-1)^{n+m}(-2)^{r+s}\binom nr\binom ms\binom{N-r}m\binom{N-s}n$ for all $0\le n\le N$, @MarkoRiedel proves that this indeed equals $2^n$ for all $0\le i\le n$. $\quad\square$
