This is all in the context of a Hilbert system with modus ponens $A, A\to B \vdash B$ and axioms:
Axiom $1$: $A \to (B \to A)$
Axiom $2$: $(A \to (B \to C)) \to ((A \to B) \to (A \to C))$
Axiom $3$: $(\lnot B \to \lnot A) \to (A \to B)$
So I tried to prove double-negation elimination by doing the following:
\begin{array}{ccc} 1 & \{ \lnot \lnot a \} \vdash \lnot \lnot a & \text{Premise}\\ 2 & \{ \lnot \lnot a \} \vdash \lnot \lnot a \to (\lnot \lnot \lnot \lnot a \to \lnot \lnot a) & \text{ Axiom } 1\\ 3 & \{ \lnot \lnot a \} \vdash \lnot \lnot \lnot \lnot a \to \lnot \lnot a & \text{ Modus Ponens } 1, 2\\ 4 & \{ \lnot \lnot a \} \vdash (\lnot \lnot \lnot \lnot a \to \lnot \lnot a) \to (\lnot a \to \lnot \lnot \lnot a) & \text{ Axiom } 3\\ 5 & \{ \lnot \lnot a \} \vdash \lnot a \to \lnot \lnot \lnot a & \text{ Modus Ponens } 3, 4\\ 6 & \{ \lnot \lnot a \} \vdash (\lnot a \to \lnot \lnot \lnot a) \to (\lnot \lnot a \to a) & \text{ Axiom } 3\\ 7 & \{ \lnot \lnot a \} \vdash \lnot \lnot a \to a & \text{ Modus Ponens } 5, 6\\ 8 & \{ \lnot \lnot a \} \vdash a & \text{ Modus Ponens } 1, 7\\ 9 & \vdash \lnot \lnot a \to a & \text{ Deduction Theorem } \\ \end{array}
And then I continued on, to prove double negation introduction:
\begin{array}{ccc} 10 & \vdash \lnot \lnot \lnot a \to \lnot a & \text{Double Negation Elimination}\\ 11 & \vdash (\lnot\lnot \lnot a \to \lnot a) \to (a \to \lnot \lnot a) & \text{ Axiom } 3\\ 12 & \vdash a \to \lnot \lnot a & \text{ Modus Ponens } 10, 11\\ \end{array}
My questions:
Am I allowed to invoke the deduction theorem in the middle of a proof like this (step $9$)? Is this considered a context change? Is context-changing allowed?
Are the proofs even right/correct?
Assuming it's all correct: Are we able to combine them to say that $a \to \lnot \lnot a$ and $\lnot \lnot a \to a$, therefore $a \iff \lnot \lnot a$ or is this symbol not allowed?
What ultimately let us say $\lnot \lnot a = a$, the use of the equal sign here?