TITLE: Can an algorithm be part of a proof?
QUESTION [18 upvotes]: I am an undergraduate student. I have read several papers in graph theory and found something may be strange: an algorithm is part of a proof. In the paper, except the last two sentences, other sentences describe a labeling algorithm.
Can an algorithm be part of a proof? I do not understand why it can be part of a proof. I asked my supervisor but he did not explain it.

LEMMA$\,\,\,\bf 1.$ If $B(G)-b$, then $B(G+e)<2b$.  Proof:
  Let $f$ be an optimal numbering of $G$, and let $V(G)-\{v_1,\ldots,v_n\}$, numbered so that $f(v_i)-i$. Let $v_lv_m$ be the added edge. We define a new numbering $f'$ such that $|f'(x)-f'(y)|<2|f(x)-f(y)|$, and also $|f'(v_l)-f'(v_m)|-1$. Let $r-\lfloor(l+m)/2\rfloor$, and set $f'(v_r)-1$ and $f'(v_{r+1})-2$. For every other $v_i$ such that $|i-r|<\min\{r-1,n-r\}$, let $f'(v_i)-f'(v_{i+1})+2$ if $i<r$ and $f'(v_i)-f'(v_{i-1})+2$ if $i>r$. This defines $f'$ for all vertices except a set of the form $v_i,\ldots,v_k$ or $v_{n+1-k},\ldots,v_n$, depending on the sign of $r-\lfloor(n+1)/2\rfloor$. In the first case, we assign $f'(v_i)-n+1-i$ for $i<k$; in the second, we assign $f'(v_i)-i$ for $i>n-k$. The renumbering $f'$ numbers the vertices outward from $v_r$ to achieve $|f'(x)-f'(y)|<2|f(x)-f(y)|$. Since we begin midway between $v_l$ and $v_m$, we also have $|f'(v_l)-f'(v_m)|-1$.

REPLY [3 votes]: By the Curry-Howard correspondence, any logical proposition in intuitionistic logic can be taken as the type signature of a lambda calculus expression. Equivalently one might use combinators rather than lambdas, and have one combinator corresponding to each logical axiom or inference rule.
Lambda calculus with types is powerful enough to be a real programming language; indeed there are several programming languages in use today which are little more than lambda calculus with additional types such as machine integers and efficient data structures, and a healthy dose of syntactic sugar.
Lambda calculus is also turing complete, meaning you can use a turing machine for a proof of a logical statement too.
Therefore, an algorithm (which has been proven correct) is a proof.