the principle of mathematical induction says: $$\forall P,\quad [P(0) \land\forall n, P(n)\to P(n+1)]\quad \to \quad \forall n, P(n)$$
The proof I've seen for this is by contradiction: Assume that the conclusion doesn't hold. Then by well-orderedness there is a smallest element $x$ that doesn't satisfy $P$. Hence $x-1$ satisfies $P$, and by the induction step, so does $x$. Contradiction.
However, this proof does not actually have the structure in which I naturally think if induction. I think of induction as using the induction hypothesis to iterate/recurse sequentially over all the numbers, until you've reached the number that you want.
The way I intuitively think of induction corresponds much more to an iterative algorithm. In this sense induction is constructive, and the (classical logical) notion of proving $\phi$ by showing $\phi \to \neg \phi$ seems unnecessary. I would like to think of induction as a constructive idea, as a recursive program (in the sense of "proofs as programs" in the curry-howard isomorphism, without using classical logic).
The idea I came up with is to simply directly define a recursive proof, but it doesn't seem sensible:
$$\begin{align}\text{ind}&:\forall n, P(n)\to P(n+1)\\ \text{base}&:P(0)\\ \text{general}&:\forall n, P(n) := \lambda n, \begin{cases}\text{base}\quad & \text {if } n=0\\ \text{ind}(n-1) (\text{general}(n-1))&\text{else}\end{cases} \end{align}$$
Is there a way to think of induction like this, as a constructive program using recursion? I don't think my particular way of doing it is strictly speaking correct.