Background
I am following this MIT OCW course on mathematics for computer science. In one of the recitations they come to the below result:
Official solution
Task:
A planar graph is a graph that can be drawn without any edges crossing. Also, any planar graph has a node of degree at most 5. Now, prove by induction that any planar graph can be colored in at most 6 colors.
Solution.:
We prove by induction. First, let n be the number of nodes in the graph. Then define P (n) = Any planar graph with n nodes is 6-colorable. Base case, P (1): Every graph with n = 1 vertex is 6-colorable. Clearly true since it’s actually 1-colorable. Inductive step: P (n) → P (n + 1): Take a planar graph G with n + 1 nodes. Then take a node v with degree at most 5 (which we know exists because we know any planar graph has a node of degree ≤ 5), and remove it. We know that the induced subgraph G’ formed in this way has n nodes, so by our inductive hypothesis, G’ is 6-colorable. But v is adjacent to at most 5 other nodes, which can have at most 5 different colors between them. We then choose v to have an unused color (from the 6 colors), and as we have constructed a 6-coloring for G, we are done with the inductive step. Because we have shown the base case and the inductive step, we have proved ∀n ∈ Z+ : P (n) (Note: Z+ refers to the set of positive integers.)
My Question
To me the inductive step is "backwards", because it proves P(n+1) -> P(n) and then get's to assume P(n) to be true by the inductive hypothesis. Why is this legal? To illustrate my problem, consider the below bogus-proof that sounds "the same" to me.
Thm. "At school, no kid has more than 6 friends." Assume that there is always one guy who has 5 friends or less. Proof by induction over the number of kids in school. Base Case: n = 1, is obviously true: Kid cannot have any friends, if only child.
Inductive step: P (n) → P (n + 1): Take a school G with n + 1 kids. Then take a kid v with at most 5 friends (which we know exists by assumptions), and remove it. We know that the induced sub-school G’ formed in this way has n kids, so by our inductive hypothesis, in G' no one has more than 6 friends. I can then add v back in and know that he has less than 6 friends. q.e.d.
There must be something I am missing, but both proofs look equally flawed to me. I would truly appreciate, if you could break it down to me. I am not questioning the theorem, just the procedure of starting with the case n+1 and then very cleverly choosing how to go backwards to n. At best, to me, this proves P(n+1) -> P(n), but not P(n) -> P(n+1).
Update
Thank you everyone! It was so wonderful to get so many answers on such niche problem. I was precisely hung up on starting with n+1 in conjunction with the fact that I get to “choose” how to go to n from there. I think I can now verbalize a little better, why I felt unhappy with the proof:
In my mind, whenever I look at induction proofs, I model it a bit like a recursive function call in code. I had never explicitly done this, but to illustrate my confusion, here is what they are doing in pseudo-code (in my mind at least):
is6Colorable(graph):
if graph.size == 1: # base case
return true
else:
specialNode = findSomeDegree5orFewerNode(graph)
subgraph = graph.drop(specialNode)
return is6colorable(subgraph)
Notice how I can rename the function in a meaningful way for any statement that is true for both the base case and the special node and it will always return true for a planar graph? E.g. verifyThatNoNodeInThisGraphHasMoreThan5Degrees(graph). In fact, I could rename it most anything that holds for the base case and it would return true and still have some meaning attached (e.g. isNumberOfVerticesOdd(graph) ) So that is obviously garbage code (I could just return "true") and it felt circular to me.
The crux – to me – is that all of the heavy lifting of this proof is done by the fact that adding a degree-5-or-fewer-node to a graph, cannot “taint” the 6-colorability for all the other nodes. (This does not hold for all other statements that are true for the base case and the specialNode. E.g. it might change the number of edges that some of the nodes in the sub-graph have, so I cannot prove that all nodes have degree 5 or less like I suggested above). That means I can deconstruct every graph to the base case, only removing nodes that when added back in, do not taint the 6-color-ability of the induced sub-graph. If I can deconstruct it that way, I can re-construct it that way.
Perhaps, you can see from my code example, how I struggled with the wording of the official proof, though: The induction they do – to me at least – does not add any insight. It is valid “code” and it returns the correct result, but it is void of insight.
I think what is confusing you is that you are "starting out" with a planar graph of $n+1$ nodes.
But note that you are not yet saying anything about its colorability. All you're trying to show here is that $P(n) \to P(n+1)$, or:
"Any planar graph with $n$ nodes is $6$-colorable" $\to$ "Any planar graph with $n+1$ nodes is $6$-colorable"
The inductive proof here "starts out" with some arbitrary planar graph of $n+1$ nodes, but we're not saying it's $6$-colorable yet. What we do know about this planar graph is that it has some node with degree $\leq 5$ in it somewhere, something we know is true for all planar graphs. We label this node $v$ and remove it for now.
What do we have left? A planar graph of $n$ nodes, which is $6$-colorable because we've assumed it via $P(n)$.
The nodes that $v$ was connected to can have at most $5$ colors among them. So we connect $v$ back to those nodes again, and color it something different (from those nodes), resulting in (at most) $6$ colors between those $\leq 5$ nodes and $v$. Now we've shown that $P(n) \to P(n+1)$ because we end with the same arbitrary planar graph we began with, but now we know it's $6$-colorable. The fact that the planar graph is arbitrary is important, because we are trying to prove that $P$ holds for "any" planar graph.
In other words, the pathway is more like "arbitrary $n+1$ node planar graph" -> "a reduced $n$ node planar graph that is $6$-colorable" -> "that arbitrary $n+1$ node planar graph is indeed $6$-colorable too".
It begs the question, why not just "start out" with a planar graph of $n$ nodes and then go straight to the graph of $n+1$ nodes? There are some potential issues with such an approach.
For example:
I want to prove that all planar graphs are $3$-colorable. $P(1), P(2), P(3)$, trivially true. Now for $P(n) \to P(n+1)$, I start out with a graph of $n$ nodes that is $3$-colorable. I add a node to it such that it is connected to $2$ nodes of $2$ different colors, and color my new node a third color. Boom! Now we've made a graph of $n+1$ nodes with at most $3$ colors and we haven't violated the fact that all planar graphs have at least one node of degree $\leq 5$...
...wait, not so fast! What have I actually shown here? I've just shown that if you have a $3$-colored graph, you can make another $3$-colored graph with one more node as long as you attach it in a very particular way.
I need to show it holds for any $3$-colorable planar graph. What if we're talking about a graph with a triangle in it ($3$ nodes, $3$ colors) and I add the extra node right in the middle, and connect it to all three vertices? That's a valid $n+1$ graph too, and yet... I need a fourth color. So this proof fails.
In other words, it becomes harder to go from the $n$ case directly to the $n+1$ case because now you have to consider all the possible ways you can hook up that extra node, and all the various ways you might get contradicted.
This is why it's way easier to start from the arbitrary $n+1$ graph, because you are immediately granted the existence of a special node, and then you can say something about the colorability of the reduced $n$ graph, and use that to say something about the colorability of the original $n+1$ graph. And since this works for any $n+1$ planar graph you started with, the resulting conclusion holds for all planar graphs.