With the exception of example 3 (which is possibly a bad example, see the discussion above), this is because of how much code is necessary to tell what's going on, rather than an increase in code size.
Example 1: 5->1: It did get shorter.
Example 2: 5->8: One of the lines is showing a line calling the check_for_overheating method, which wasn't shown in the first example. The other two are declaring the SystemMonitor class, which was declared "off-screen" before.
Example 4: 7->13: Five lines for declaring and defining User.address, which was off-screen before. So it did get a line longer.
Example 1: 5->1: It did get shorter.
Example 2: 5->8: One of the lines is showing a line calling the check_for_overheating method, which wasn't shown in the first example. The other two are declaring the SystemMonitor class, which was declared "off-screen" before.
Example 4: 7->13: Five lines for declaring and defining User.address, which was off-screen before. So it did get a line longer.