I'm going to skip the math, not because I can't do it but because it's not necessary to prove your case. When your friend walks, he uses various muscles as his stride proceeds. At intervals, each of those muscles has cycles of flexing and rest. Same for your pedalling. So, each activity "cheats" by your friend's definition.
Now, about that coasting: sure, you've broken the rhythm. But you are likely also doing something else. For example, when you descend at speed you may be expending quite a bit of energy holding a tuck or dealing with the steering around that skunk carcass in the curve. Even when you're lolly-gagging on the flats you may bend down and get your water bottle. Every movement does some chemical work (and some of them do physical work too).