# Try to defeat the hydra!

The hydra currently has: segments, heads, and depth . Hercules has cut heads so far.

Click on a head to chop it off.

• When a normal neck segment () is cut off, the grandfather node of the severed head, if any, can afterward grow back as many copies as the hydra wishes of the entire subtree from which the head was cut off (i.e., the father node of the severed head and all its descendants).
• When a dire neck segment () is cut off, the father node of the severed head can afterward grow back a copy of the entire subtree back from and including the last normal (i.e., non-dire) segment in its ancestors, recursively as deep as the hydra wishes.

Nodes which have just grown back are shown slightly blueish ().

Mathematical fact: no matter what you do and no matter how much the hydra chooses to replicate when you cut off its heads, the hydra will always be defeated in a finite amount of time. (Of course, in this particular JavaScript implementation, the hydra is very tame, and only actually grows parts back when it won't clutter the display too much. So it's really very easy to defeat the hydra.) Metamathematical fact (needs to be checked precisely): the previous mathematical fact (suitably formalized) cannot be proven in Kripke–Platek set theory (essentially, because it requires a transfinite induction on the Bachmann–Howard ordinal, which is the proof ordinal of Kripke–Platek).