Let n be given.
Assume Hn.
Apply IHn to the current goal.
Let Y be given.
Assume H.
Apply H to the current goal.
Apply HYn to the current goal.
Let f be given.
Apply Hf to the current goal.
Assume H.
Apply H to the current goal.
We prove the intermediate
claim L1:
∃z ∈ X, z ∉ Y.
Apply dneg to the current goal.
We prove the intermediate
claim L1a:
Y = X.
An exact proof term for the current goal is HY.
Let z be given.
Apply dneg to the current goal.
Apply H1 to the current goal.
We use z to witness the existential quantifier.
Apply andI to the current goal.
An exact proof term for the current goal is HzX.
An exact proof term for the current goal is HzY.
Apply HX to the current goal.
We use n to witness the existential quantifier.
Apply andI to the current goal.
An
exact proof term for the current goal is
nat_p_omega n Hn.
rewrite the current goal using L1a (from right to left).
An exact proof term for the current goal is HYn.
Apply L1 to the current goal.
Let z be given.
Assume H.
Apply H to the current goal.
We use
Y ∪ {z} to
witness the existential quantifier.
Apply andI to the current goal.
We will
prove Y ∪ {z} ⊆ X.
An exact proof term for the current goal is HY.
Let w be given.
rewrite the current goal using
SingE z w Hw (from left to right).
An exact proof term for the current goal is HzX.
We prove the intermediate
claim Lg:
∃g : set → set, (∀y ∈ Y, g y = f y) ∧ g z = n.
Set g to be the term
λy ⇒ if y ∈ Y then f y else n of type
set → set.
We use g to witness the existential quantifier.
Apply andI to the current goal.
Let y be given.
Assume Hy.
An
exact proof term for the current goal is
If_i_1 (y ∈ Y) (f y) n Hy.
An
exact proof term for the current goal is
If_i_0 (z ∈ Y) (f z) n HzY.
Apply Lg to the current goal.
Let g be given.
Assume H.
Apply H to the current goal.
We use g to witness the existential quantifier.
Apply and3I to the current goal.
Let u be given.
Assume Hu.
rewrite the current goal using HgY u H1 (from left to right).
An exact proof term for the current goal is Hf1 u H1.
rewrite the current goal using
SingE z u H1 (from left to right).
rewrite the current goal using Hgz (from left to right).
Let u be given.
Assume Hu.
Let v be given.
Assume Hv.
rewrite the current goal using HgY u H1 (from left to right).
rewrite the current goal using HgY v H2 (from left to right).
An exact proof term for the current goal is Hf2 u H1 v H2.
rewrite the current goal using
SingE z v H2 (from left to right).
rewrite the current goal using Hgz (from left to right).
rewrite the current goal using H3 (from right to left) at position 1.
An exact proof term for the current goal is Hf1 u H1.
rewrite the current goal using
SingE z u H1 (from left to right).
rewrite the current goal using Hgz (from left to right).
rewrite the current goal using HgY v H2 (from left to right).
rewrite the current goal using H3 (from left to right) at position 1.
An exact proof term for the current goal is Hf1 v H2.
Assume _.
Use symmetry.
An
exact proof term for the current goal is
SingE z v H2.
Let i be given.
Apply ordsuccE n i Hi to the current goal.
Apply Hf3 i H1 to the current goal.
Let y be given.
Assume H.
Apply H to the current goal.
We use y to witness the existential quantifier.
Apply andI to the current goal.
We will
prove y ∈ Y ∪ {z}.
An exact proof term for the current goal is Hy.
rewrite the current goal using HgY y Hy (from left to right).
An exact proof term for the current goal is Hfyi.
We use z to witness the existential quantifier.
Apply andI to the current goal.
We will
prove z ∈ Y ∪ {z}.
Apply SingI to the current goal.
rewrite the current goal using H1 (from left to right).
An exact proof term for the current goal is Hgz.
∎