Some questions about the properties of equality Given the reflexive property of equality and the axiom of substitution, we can prove the property of symmetry. I came across the following proof:


*

*$\alpha=\beta$
(hypothesis)

*$\alpha=\alpha$
(axiom of reflexivity)

*$\alpha=\beta\rightarrow\left(\alpha=\alpha\rightarrow\beta=\alpha\right)$
(axiom of substitution)

*$\alpha=\alpha\rightarrow\beta=\alpha$
(MP 3,1)

*$\beta=\alpha$
(MP 4,2) 
First question: I think the above proof is not correct. The axiom of substitution, $\alpha=\beta\rightarrow\left[P(\alpha)\rightarrow P(\beta)\right]$
 , requires that every free occurrence of $\alpha$
  in $P$, is replaced by $\beta$
 . Then, (3) should have been: $\alpha=\beta\rightarrow\left(\alpha=\alpha\rightarrow\beta=\beta\right)$. Am I right?
I also came across the following trick: Let $\alpha=\beta$
  and let $P(x)$
  be the predicate $x=\alpha$
 . Then, obviously, $P(\alpha)$, since $\alpha=\alpha$
  is an axiom. So:


*

*$\alpha=\beta$
(hypothesis)

*$P(\alpha)\leftrightarrow\alpha=\alpha$
(definition of $P(x)$)

*$\alpha=\alpha$
(axiom of reflexivity)

*$P(\alpha)$
(BMP 2,3)

*$\alpha=\beta\rightarrow\left[P(\alpha)\rightarrow P(\beta)\right]$
(axiom of substitution)

*$P(\alpha)\rightarrow P(\beta)$
(MP 5,1)

*$P(\beta)$
(MP 6,4)

*$P(\beta)\leftrightarrow\beta=\alpha$
(definition of $P(x)$
)

*$\beta=\alpha$
(BMP 8,7)
Second question: I think the above proof is also not correct, strictly speaking. Why, how is it justified to attribute to $x=\alpha$
  the name $P(x)$? To put it differently, by which inference rule we get the formula $P(x)\leftrightarrow x=\alpha$? Not by modus ponens, not by replacing variables in a given propositional schema, not by universal generalization. But these are all inference rules that we have at our disposal. Therefore, the formula $P(x)\leftrightarrow x=\alpha$
  is arbitrary, right?
After all, if it is legitimate to produce the formula $P(x)\leftrightarrow x=\alpha$
  by naming "$x=\alpha$" as "$P(x)$", then - by analogy - why we can not produce the sentence $\varepsilon=\alpha$,  by naming $\alpha$ with the new name "$\varepsilon$"? Here we just assign the value $\alpha$
  to the new symbol "$\varepsilon$", which has not been used before. But then, we can prove the reflexive property with the following instance of the substitution axiom: $\varepsilon=\alpha\rightarrow\left(\varepsilon=\alpha\rightarrow\alpha=\alpha\right)$. However, in all the books I have read, it is taken for granted that the reflexive property can not be proven. Besides, who assures us that there is an $\varepsilon$
 , such that $\varepsilon=\alpha$
 ? If $\alpha=\alpha$
  does not hold, we have no reason to suppose that such an $\varepsilon$
  exists. If it does hold, we get $\exists x(x=\alpha)$
  with existential generalization and $\varepsilon=\alpha$
  with existential determination. So, the reflexive property is equivalent to the ability to assign a value to a new symbol. If one of the two applies, then the other applies. This shows that we can not arbitrarily attribute a value to a new symbol, or a name to an object, for proof purposes. An axiom is needed. Why should we believe we are entitled to do something similar with a predicate?
Third question: If indeed the above proofs are not correct, then how do we prove the property of symmetry of equality in ordinary first order logic? (Without set theory, and the proof must be strict).
 A: First question: No. The axiom of substitution does not require all occurrences to be replaced. In fact, you don't have to replace any at all. Thus, you could even infer $\alpha = \alpha$ from $\alpha = \alpha$ and $\alpha = \beta$. 
It is important that you don't have to replace occurrences, for otherwise, as you worried in your third question, you would indeed not be able to prove symmetry from reflexivity and substitution.
Second question: One way to define $P(x)$ as '$x=\alpha$' is to have a definitional axiom:
$\forall x (P(x) \leftrightarrow x = \alpha)$
So, you could eliminate the universal and instantiate it with $\alpha$ to get line 2, and call it 'by definition of $P(x)$', since you are indeed inferring it from the definitional axiom.
A: There is quite a subtle point here...
The equality axiom regarding substitution for formulas can be expressed in different way.
We may have :

$x = y → (α → α'),$

where $α$ is atomic and $α'$ is obtained from $α$ by replacing $x$ in zero or more (but not necessarily all) places by $y$.
Alternatively, we may formulate it using the operation of substitution :

$s=t \to (\varphi[s/x] \to \varphi [t/x]).$

We have to note that the substitution axiom is a schema, where $\varphi$ is a meta-variable representing a formula.
The operation of substitution for first-order logic expressions is defined as follows.
Suppose $E$ is an expression, $y$ is a variable and $t$ is a term that is substitutable for $y$ in $E$. We write

$E[t/y]$

for the expression got from $E$ by simultaneously replacing each free occurrence of each $y$ in $E$ by $t$. 

Now for the proof of symmetry of equality :
1) $s=t$ --- premise
2) $s=s$ --- axiom : it is $\varphi[s/x]$, with $x=s$ as $\varphi$
3) $s=t \to (s=s \to t=s)$ --- axiom : where $t=s$ is $\varphi[t/x]$, with $x=s$ as $\varphi$

4) $t=s$ --- from 1),2) and 3) by modus ponens twice.


We can see : Dirk van Dalen, Logic and Structure, Springer (5th ed - 2013), page 93 : 

$$\frac { x_1 = y_1, \ldots, x_n = y_n \quad \quad \quad ϕ(x_1,\ldots, x_n) } { ϕ(y_1,\ldots, y_n)}$$
where $y_1,\ldots, y_n$ are free for $x_1,\ldots, x_n$ in $ϕ$. 
Note that we want to allow substitution of the variable $y_i (i ≤ n)$ for some and not necessarily all occurrences of the variable $x_i$.

If we want to formulate the rule using the simultaneous substitution operator, we must have :

$$\frac { x_1 = y_1, \ldots, x_n = y_n \quad \quad \quad ϕ[x_1,\ldots, x_n/z_1,\ldots,z_n] } { ϕ[y_1,\ldots, y_n/z_1,\ldots,z_n]}.$$



Cohen's formulation of the substitution rule : 

Rule C (Rules of Equality) : if $A$ is a statement [formula], $c$ and $c'$ constants symbols and if $A'$ represents $A$ with every occurrence of $c$ replaced by $c'$, then $(c=c') \to (A \to A')$ is a valid statement,

is a little bit sloppy. If we want to use "full" replacement we must have $A[c/x]$ and $A[c'/x]$.
