Splitting of coherent idempotents

An answer to a question of Martin Escardo.
Coq wasn't able to deal with the obvious proof term `fun x => (fun n => f x ; fun n => I x)`, and I thought making it a script was easier and more readable than figuring out how to annotate the term to convince Coq to accept it.