Let X, Y, Z, f and g be given.
Let x be given.
We prove the intermediate
claim HfxY:
apply_fun f x ∈ Y.
An exact proof term for the current goal is (Hf x HxX).
An
exact proof term for the current goal is
(Hg (apply_fun f x) HfxY).
rewrite the current goal using Happ (from left to right).
An exact proof term for the current goal is HgfxZ.
∎