https://github.com/leanprover/cslib/blob/1bb3a546874e8d68bcb3205cbbbc84d6d8884cda/Cslib/Computability/Automata/NA/Sum.lean#L61