Following up on this post denoting $(x \leftrightarrow y)$ the permutation of $x$ and $y$ and $P[x \leftrightarrow y]$ the term obtained from the term $P$ by permuting $x$ and $y$ (so for example if $P = \lambda x. \lambda y. x y$ then we have $P[x \leftrightarrow y] = \lambda y. \lambda x. y x$) (note that such transformation is immune from potential variable capture unlike those based on substitutions $y \leftarrow x$ or $x \leftarrow y$), then it appears to me that when $x \ne y$, a term $\lambda x. P$ is alpha equivalent to a term $\lambda y. Q$ if and only if $y$ is not free in $P$ and $Q$ is alpha equivalent to $P[y \leftrightarrow x]$. I find this observation interesting because it lends itself to a simple recursion in order to establish alpha-equivalence (as opposed to using an algorithm based on de Bruijn indices). I would like to know whether anyone thinks this observation is wrong, or whether it is true (a proof sketch or counterexample is welcome), or whether while true, it is not very interesting because the complexity of the recursive computation would be worse than a solution based on de Bruijn indices (each step requires determining whether $y$ is free in $P$ and permuting variable $x$ and $y$ in $P[x \leftrightarrow y]$).