We prove the intermediate
claim HflNot:
fl0 ∉ {lastval}.
We prove the intermediate
claim Heq:
fl0 = lastval.
An
exact proof term for the current goal is
(SingE lastval fl0 Hmem).
An exact proof term for the current goal is (HneqLast Heq).
We prove the intermediate
claim HflInDrop:
fl0 ∈ (F0 ∖ {lastval}).
An
exact proof term for the current goal is
(setminusI F0 {lastval} fl0 Hfl0 HflNot).
rewrite the current goal using Hm1Def (from right to left).
We prove the intermediate
claim HbijDrop2:
bijection m1 (F0 ∖ {lastval}) e0.
We prove the intermediate
claim HlastEq:
apply_fun e0 m1 = lastval.
rewrite the current goal using HlastEq (from right to left) at position 1.
An exact proof term for the current goal is HbijDrop.
Let f be given.
An
exact proof term for the current goal is
(HvalUI0 f (setminusE1 F0 {lastval} f Hf)).
An
exact proof term for the current goal is
(IHt (F0 ∖ {lastval}) e0 fl0 HtO HbijDrop2 HflInDrop HvalUIDrop).
Apply HmoveSmall to the current goal.
Let e1 be given.
Assume He1pack.
We prove the intermediate
claim He1last:
apply_fun e1 t = fl0.
We prove the intermediate
claim He2m1:
apply_fun e2 m1 = lastval.
We prove the intermediate
claim Hrefl:
m1 = m1.
rewrite the current goal using
(If_i_1 (m1 = m1) lastval (apply_fun e1 m1) Hrefl) (from left to right).
Use reflexivity.
Apply andI to the current goal.
Let k be given.
Apply (xm (k = m1)) to the current goal.
rewrite the current goal using
(If_i_1 (k = m1) lastval (apply_fun e1 k) Hkm1) (from left to right).
An exact proof term for the current goal is HlastF0.
rewrite the current goal using
(If_i_0 (k = m1) lastval (apply_fun e1 k) Hknm1) (from left to right).
We prove the intermediate
claim HkInM1:
k ∈ m1.
Apply (ordsuccE m1 k HkDom) to the current goal.
An exact proof term for the current goal is HkM1.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hknm1 Hkeq).
We prove the intermediate
claim He1fun:
function_on e1 m1 (F0 ∖ {lastval}).
We prove the intermediate
claim He1kDrop:
apply_fun e1 k ∈ (F0 ∖ {lastval}).
An exact proof term for the current goal is (He1fun k HkInM1).
Let y be given.
Apply (xm (y = lastval)) to the current goal.
We use m1 to witness the existential quantifier.
Apply andI to the current goal.
Apply andI to the current goal.
An
exact proof term for the current goal is
(ordsuccI2 m1).
rewrite the current goal using HyLast (from left to right).
An exact proof term for the current goal is He2m1.
Let k' be given.
Apply (xm (k' = m1)) to the current goal.
An exact proof term for the current goal is H.
We prove the intermediate
claim HkInM1:
k' ∈ m1.
Apply (ordsuccE m1 k' Hk'Dom) to the current goal.
An exact proof term for the current goal is HkM1.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hkn Hkeq).
We prove the intermediate
claim He1fun:
function_on e1 m1 (F0 ∖ {lastval}).
We prove the intermediate
claim He1kDrop:
apply_fun e1 k' ∈ (F0 ∖ {lastval}).
An exact proof term for the current goal is (He1fun k' HkInM1).
We prove the intermediate
claim Hnot:
apply_fun e1 k' ∉ {lastval}.
rewrite the current goal using
(If_i_0 (k' = m1) lastval (apply_fun e1 k') Hkn) (from left to right).
Use reflexivity.
We prove the intermediate
claim He1eqLast:
apply_fun e1 k' = lastval.
rewrite the current goal using HyLast (from right to left).
rewrite the current goal using He2k (from right to left).
An exact proof term for the current goal is Heq.
We prove the intermediate
claim Hmem:
apply_fun e1 k' ∈ {lastval}.
rewrite the current goal using He1eqLast (from left to right).
An
exact proof term for the current goal is
(SingI lastval).
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hnot Hmem).
We prove the intermediate
claim HyDrop:
y ∈ (F0 ∖ {lastval}).
An
exact proof term for the current goal is
(setminusI F0 {lastval} y HyF0 (λHyS : y ∈ {lastval} ⇒ HyNLast (SingE lastval y HyS))).
We prove the intermediate
claim Hsurj1:
∃k0 : set, k0 ∈ m1 ∧ apply_fun e1 k0 = y ∧ (∀k' : set, k' ∈ m1 → apply_fun e1 k' = y → k' = k0).
Apply Hbij1 to the current goal.
Assume _ Huniq.
An exact proof term for the current goal is (Huniq y HyDrop).
Apply Hsurj1 to the current goal.
Let k0 be given.
Assume Hk0pack.
We prove the intermediate
claim Hk0left:
k0 ∈ m1 ∧ apply_fun e1 k0 = y.
An
exact proof term for the current goal is
(andEL (k0 ∈ m1 ∧ apply_fun e1 k0 = y) (∀k' : set, k' ∈ m1 → apply_fun e1 k' = y → k' = k0) Hk0pack).
We prove the intermediate
claim Hk0In:
k0 ∈ m1.
An
exact proof term for the current goal is
(andEL (k0 ∈ m1) (apply_fun e1 k0 = y) Hk0left).
We prove the intermediate
claim Hk0Eq:
apply_fun e1 k0 = y.
An
exact proof term for the current goal is
(andER (k0 ∈ m1) (apply_fun e1 k0 = y) Hk0left).
We prove the intermediate
claim Hk0uniq:
∀k' : set, k' ∈ m1 → apply_fun e1 k' = y → k' = k0.
An
exact proof term for the current goal is
(andER (k0 ∈ m1 ∧ apply_fun e1 k0 = y) (∀k' : set, k' ∈ m1 → apply_fun e1 k' = y → k' = k0) Hk0pack).
We use k0 to witness the existential quantifier.
Apply andI to the current goal.
Apply andI to the current goal.
An
exact proof term for the current goal is
(ordsuccI1 m1 k0 Hk0In).
We prove the intermediate
claim Hk0Dom:
k0 ∈ ordsucc m1.
An
exact proof term for the current goal is
(ordsuccI1 m1 k0 Hk0In).
We prove the intermediate
claim Hk0nm1:
¬ (k0 = m1).
We prove the intermediate
claim Hmm1:
m1 ∈ m1.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is Hk0In.
An
exact proof term for the current goal is
((In_irref m1) Hmm1).
rewrite the current goal using
(If_i_0 (k0 = m1) lastval (apply_fun e1 k0) Hk0nm1) (from left to right).
An exact proof term for the current goal is Hk0Eq.
Let k' be given.
Apply (xm (k' = m1)) to the current goal.
Apply FalseE to the current goal.
We prove the intermediate
claim He2kLast:
apply_fun e2 k' = lastval.
rewrite the current goal using Hkm1 (from left to right).
An exact proof term for the current goal is He2m1.
We prove the intermediate
claim HyEqA:
y = apply_fun e2 k'.
rewrite the current goal using Heq (from right to left).
Use reflexivity.
We prove the intermediate
claim HyEqLast:
y = lastval.
An
exact proof term for the current goal is
(eq_i_tra y (apply_fun e2 k') lastval HyEqA He2kLast).
An exact proof term for the current goal is (HyNLast HyEqLast).
We prove the intermediate
claim HkInM1:
k' ∈ m1.
Apply (ordsuccE m1 k' Hk'Dom) to the current goal.
An exact proof term for the current goal is HkM1.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hkn Hkeq).
rewrite the current goal using
(If_i_0 (k' = m1) lastval (apply_fun e1 k') Hkn) (from left to right).
Use reflexivity.
We prove the intermediate
claim He1eqY:
apply_fun e1 k' = y.
rewrite the current goal using He2k (from right to left).
An exact proof term for the current goal is Heq.
An exact proof term for the current goal is (Hk0uniq k' HkInM1 He1eqY).
An exact proof term for the current goal is (HvalUI0 lastval HlastF0).
rewrite the current goal using
(nat_primrec_S 0 (step e0) m1 Hm1Nat) (from left to right).
rewrite the current goal using
(nat_primrec_S 0 (step e2) m1 Hm1Nat) (from left to right).
rewrite the current goal using Hm1Def (from left to right).
An exact proof term for the current goal is HsumSmall.
Let k be given.
We prove the intermediate
claim HkDom:
k ∈ ordsucc m1.
An
exact proof term for the current goal is
(ordsuccI1 m1 k HkM1).
We prove the intermediate
claim Hknm1:
¬ (k = m1).
We prove the intermediate
claim Hmm1:
m1 ∈ m1.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is HkM1.
An
exact proof term for the current goal is
((In_irref m1) Hmm1).
rewrite the current goal using
(If_i_0 (k = m1) lastval (apply_fun e1 k) Hknm1) (from left to right).
Use reflexivity.
rewrite the current goal using He2k (from right to left).
Use reflexivity.
rewrite the current goal using HaccEq (from left to right).
We prove the intermediate
claim He2m1F:
apply_fun e2 m1 = lastval.
An exact proof term for the current goal is He2m1.
rewrite the current goal using He2m1F (from left to right).
Use reflexivity.
We use e' to witness the existential quantifier.
Apply andI to the current goal.
Apply andI to the current goal.
We prove the intermediate
claim HtIn:
t ∈ ordsucc m1.
rewrite the current goal using Hm1Def (from right to left).
An
exact proof term for the current goal is
(ordsuccI2 m1).
Let k be given.
Apply (xm (k = m1)) to the current goal.
rewrite the current goal using Hkm1 (from left to right).
rewrite the current goal using He2m1 (from left to right).
An exact proof term for the current goal is HtermLastUI.
We prove the intermediate
claim HkInM1:
k ∈ m1.
Apply (ordsuccE m1 k HkDom) to the current goal.
An exact proof term for the current goal is HkM1.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hknm1 Hkeq).
We prove the intermediate
claim He1fun:
function_on e1 m1 (F0 ∖ {lastval}).
We prove the intermediate
claim He1kDrop:
apply_fun e1 k ∈ (F0 ∖ {lastval}).
An exact proof term for the current goal is (He1fun k HkInM1).
rewrite the current goal using
(If_i_0 (k = m1) lastval (apply_fun e1 k) Hknm1) (from left to right).
Use reflexivity.
rewrite the current goal using He2k (from left to right).
We prove the intermediate
claim HnO:
ordsucc m1 ∈ ω.
An
exact proof term for the current goal is
(omega_ordsucc m1 Hm1O2).
We prove the intermediate
claim HtInM1:
t ∈ m1.
rewrite the current goal using Hm1Def (from left to right).
An
exact proof term for the current goal is
(ordsuccI2 t).
We prove the intermediate
claim HtIn:
t ∈ ordsucc m1.
An
exact proof term for the current goal is
(ordsuccI1 m1 t HtInM1).
rewrite the current goal using Hm1Def (from right to left) at position 1.
An
exact proof term for the current goal is
(ordsuccI2 m1).
rewrite the current goal using HswapEq (from left to right).
Use reflexivity.
We prove the intermediate
claim Hm1Dom:
m1 ∈ ordsucc m1.
An
exact proof term for the current goal is
(ordsuccI2 m1).
rewrite the current goal using Hm1Def (from left to right) at position 1.
An exact proof term for the current goal is Hsa.
rewrite the current goal using HappLast (from left to right).
We prove the intermediate
claim HtDom:
t ∈ ordsucc m1.
We prove the intermediate
claim HtNeM1:
¬ (t = m1).
We prove the intermediate
claim Hm1m1:
m1 ∈ m1.
rewrite the current goal using Heq (from right to left) at position 1.
An
exact proof term for the current goal is
(ordsuccI2 t).
An
exact proof term for the current goal is
((In_irref m1) Hm1m1).
rewrite the current goal using
(If_i_0 (t = m1) lastval (apply_fun e1 t) HtNeM1) (from left to right).
Use reflexivity.
rewrite the current goal using He2t (from left to right).
An exact proof term for the current goal is He1last.