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.