The actual purpose of the "ph ->" is to introduce a hypothesis that may not always be satisfiable without some assumptions (and the exact nature of those assumptions is not known inside the theorem, so the generic "ph" is used). If we are dealing with a true abbreviation, just a short way to write some symbols, then the "D = ..." hypothesis will either be satisfied by a similar hypothesis, or by theorem eqid, which will force the substitution of "..." for "D" in the rest of the theorem. Since in any case, the hypothesis can be discharged with no assumptions, the "ph" is not necessary.
Sometimes, we wish to discharge these hypotheses with something that isn't just an abbreviation. For example, if "J e. ( TopOn ` X )", then X is the base set of the topology J, so X = U. J (toponuni), but since X = U. J is not always true in this situation, we can't prove it without the hypothesis "J e. ( TopOn ` X )". What you have to do here, if you want to use a theorem that has the hypothesis "|- X = U. J" (to prove some statement |- P(X)), is use eqid anyway, producing a proof of P(U. J), then use ( ph -> X = U. J ) and equality theorems to get ( ph -> ( P(X) <-> P(U. J) ) ), then use the proof of |- P(U. J) to yield |- ( ph -> P(X) ). An example of this procedure is the derivation of ishaus2 (which has X = U. J given the context) from ishaus (which assumes X = U. J with no context).
The above procedure is always possible to do, but it is not always convenient since many steps may be needed for the equality proof. In cases where we specifically intend to discharge the assumption with something other than eqid, we sometimes add ph -> to the equalities as well. A common example of this is in structure builder theorems, where we want to use a self-referential expression for the left hand side. For example, we might define a group by
$e |- ( ph -> B = my-base-set )
$e |- ( ph -> .+ = my-group-op(B) )
mygroupval $p |- ( ph -> MyGroup = { <. ( Base ` ndx ) , B >. , <. ( +g ` ndx ) , .+ >. } )
Suppose that my-base-set is a complicated expression, and my-group-op(B) has a lot of references to B, so the fully expanded my-group-op(my-base-set) is really big, and we don't want to use it too many times. In the same context, we then prove:
$e |- ( ph -> B = my-base-set )
$e |- ( ph -> .+ = my-group-op(B) )
mygroupbaslem $p |- ( ph -> ( Base ` MyGroup ) = my-base-set )
mygroupaddlem $p |- ( ph -> ( +g ` MyGroup ) = my-group-op(B) )
and now we can bootstrap the whole thing:
mygroupbas $p |- ( ph -> ( Base ` MyGroup ) = my-base-set ) $=
1::eqid |- ( ph -> my-base-set = my-base-set )
2::eqid |- ( ph -> my-group-op = my-group-op(my-base-set) )
qed:1,2:mygroupbaslem |- ( ph -> ( Base ` MyGroup ) = my-base-set )
mygroupadd $p |- ( ph -> ( +g ` MyGroup ) = my-base-set ) $=
1::mygroupbas |- ( ph -> ( Base ` MyGroup ) = my-base-set )
2::eqid |- ( ph -> my-group-op( ( Base ` MyGroup ) ) = my-group-op( ( Base ` MyGroup ) ) )
qed:1,2:mygroupbaslem |- ( ph -> ( +g ` MyGroup ) = my-group-op( ( Base ` MyGroup ) ) )
Note that the contained references of my-group-op are now referencing ( Base ` MyGroup ), which makes this "definition" of a component of MyGroup self-referential. But that was the goal, and we have mygroupbas to expand it as necessary. A more elaborate version of this idea is done in prdsval, with prdsbas, prdsplusg, prdsmulr, etc pulling off components and bootstrapping using the previous theorems.
Finally, there are a few places where ( ph -> X = ... ) definitions are used by convention, specifically grppropd and other *propd theorems, and isgrpd and other is*d theorems for structures.
As a rule of thumb: Use X = ... abbreviations unless you need to use a non-identity abbreviation for X later.
Mario