Definition:Theorem/Formal System

Definition
Let $\mathcal F$ be a formal system consisting of a formal language with a proof system $\mathcal D$.

A theorem is a well-formed formula in $\mathcal F$ which can be deduced from the axioms and/or axiom schemata of $\mathcal D$ by means of its rules of inference.

Also see
As can be seen, this generalises the definition in the context of logic if one defines the apparatus of logic as a formal system.