Let y1 and y2 be given.
Apply (Hsurj y1 Hy1) to the current goal.
Let x1 be given.
Apply (Hsurj y2 Hy2) to the current goal.
Let x2 be given.
We prove the intermediate
claim Hx1X:
x1 ∈ X.
An
exact proof term for the current goal is
(andEL (x1 ∈ X) (apply_fun f x1 = y1) Hx1pair).
We prove the intermediate
claim Hfx1:
apply_fun f x1 = y1.
An
exact proof term for the current goal is
(andER (x1 ∈ X) (apply_fun f x1 = y1) Hx1pair).
We prove the intermediate
claim Hx2X:
x2 ∈ X.
An
exact proof term for the current goal is
(andEL (x2 ∈ X) (apply_fun f x2 = y2) Hx2pair).
We prove the intermediate
claim Hfx2:
apply_fun f x2 = y2.
An
exact proof term for the current goal is
(andER (x2 ∈ X) (apply_fun f x2 = y2) Hx2pair).
Apply (Hpath_prop x1 x2 Hx1X Hx2X) to the current goal.
Let p be given.
We prove the intermediate
claim Hp_between:
path_between X x1 x2 p.
We prove the intermediate
claim Hp0:
apply_fun p 0 = x1.
We prove the intermediate
claim Hp1:
apply_fun p 1 = x2.
We prove the intermediate
claim Hq0:
apply_fun q 0 = y1.
rewrite the current goal using Hq0a (from left to right).
rewrite the current goal using Hp0 (from left to right).
rewrite the current goal using Hfx1 (from left to right).
Use reflexivity.
We prove the intermediate
claim Hq1:
apply_fun q 1 = y2.
rewrite the current goal using Hq1a (from left to right).
rewrite the current goal using Hp1 (from left to right).
rewrite the current goal using Hfx2 (from left to right).
Use reflexivity.
We use q to witness the existential quantifier.
Apply andI to the current goal.
Apply andI to the current goal.
Apply andI to the current goal.
An exact proof term for the current goal is Hq_fun.
An exact proof term for the current goal is Hq0.
An exact proof term for the current goal is Hq1.
An exact proof term for the current goal is Hq_cont.
∎