Lemma. Structure identity principle for co-slice morphisms [009X]

Let A be a type and let {X}\xrightarrow {{f}}{Y} be a homomorphism of A-algebras. Assuming function extensionality, the type \mathchoice {\textstyle \sum _{{\mathopen {}\left (g\colon X\to Y\right )\mathclose {}}}}{\textstyle \sum _{{\mathopen {}\left (g\colon X\to Y\right )\mathclose {}}}}{\scriptstyle \sum _{{\mathopen {}\left (g\colon X\to Y\right )\mathclose {}}}}{\scriptscriptstyle \sum _{{\mathopen {}\left (g\colon X\to Y\right )\mathclose {}}}}g\sim f of homomorphisms homotopic to f is contractible.