Let X, Tx, C and eps be given.
Assume Hpara: paracompact_space X Tx.
Assume HH: Hausdorff_space X Tx.
Assume Hloc: locally_finite_family X Tx C.
Assume HCsubPow: C 𝒫 X.
Assume Heps: ∀c : set, c Capply_fun eps c R Rlt 0 (apply_fun eps c).
Assume Hnorm: normal_space X Tx.
Assume HTx: topology_on X Tx.
We will prove ∃f : set, continuous_map X Tx R R_standard_topology f (∀x : set, x XRlt 0 (apply_fun f x)) (∀c x : set, c Cx cRle (apply_fun f x) (apply_fun eps c)).
Set U to be the term {NTx|∃x : set, x X x N ∃S : set, finite S S C ∀A : set, A CA N EmptyA S}.
We prove the intermediate claim HUcover: open_cover X Tx U.
We will prove (∀u : set, u Uu Tx) covers X U.
Apply andI to the current goal.
Let u be given.
Assume HuU: u U.
An exact proof term for the current goal is (SepE1 Tx (λN : set∃x : set, x X x N ∃S : set, finite S S C ∀A : set, A CA N EmptyA S) u HuU).
We will prove covers X U.
Let x be given.
Assume HxX: x X.
We prove the intermediate claim Hlocx: ∀x0 : set, x0 X∃N : set, N Tx x0 N ∃S : set, finite S S C ∀A : set, A CA N EmptyA S.
An exact proof term for the current goal is (andER (topology_on X Tx) (∀x0 : set, x0 X∃N : set, N Tx x0 N ∃S : set, finite S S C ∀A : set, A CA N EmptyA S) Hloc).
We prove the intermediate claim HexN: ∃N : set, N Tx x N ∃S : set, finite S S C ∀A : set, A CA N EmptyA S.
An exact proof term for the current goal is (Hlocx x HxX).
Apply HexN to the current goal.
Let N be given.
Assume HNpack.
We prove the intermediate claim HN0: (N Tx x N) ∃S : set, finite S S C ∀A : set, A CA N EmptyA S.
An exact proof term for the current goal is HNpack.
We prove the intermediate claim HNopen: N Tx.
An exact proof term for the current goal is (andEL (N Tx) (x N) (andEL (N Tx x N) (∃S : set, finite S S C ∀A : set, A CA N EmptyA S) HN0)).
We prove the intermediate claim HxN: x N.
An exact proof term for the current goal is (andER (N Tx) (x N) (andEL (N Tx x N) (∃S : set, finite S S C ∀A : set, A CA N EmptyA S) HN0)).
We prove the intermediate claim HexS: ∃S : set, finite S S C ∀A : set, A CA N EmptyA S.
An exact proof term for the current goal is (andER (N Tx x N) (∃S : set, finite S S C ∀A : set, A CA N EmptyA S) HN0).
We use N to witness the existential quantifier.
Apply andI to the current goal.
We will prove N U.
Apply (SepI Tx (λN0 : set∃x0 : set, x0 X x0 N0 ∃S : set, finite S S C ∀A : set, A CA N0 EmptyA S) N) to the current goal.
An exact proof term for the current goal is HNopen.
We use x 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 HxX.
An exact proof term for the current goal is HxN.
An exact proof term for the current goal is HexS.
An exact proof term for the current goal is HxN.
We prove the intermediate claim Hpu: partition_of_unity_dominated X Tx U.
An exact proof term for the current goal is (paracompact_Hausdorff_partition_of_unity X Tx U Hpara HH HUcover).
We prove the intermediate claim HexP: ∃P : set, partition_of_unity_family X Tx U P.
An exact proof term for the current goal is (partition_of_unity_dominated_ex_family_pred X Tx U Hpu).
Apply HexP to the current goal.
Let P be given.
Assume HP: partition_of_unity_family X Tx U P.
We prove the intermediate claim HPsubFS: P function_space X R.
An exact proof term for the current goal is (partition_of_unity_family_sub_function_space X Tx U P HP).
We prove the intermediate claim HPcont: ∀f : set, f Pcontinuous_map X Tx R R_standard_topology f.
An exact proof term for the current goal is (partition_of_unity_family_continuous X Tx U P HP).
We prove the intermediate claim HPdom: ∀f : set, f P∃u : set, u U support_of X Tx f u.
An exact proof term for the current goal is (partition_of_unity_family_support_dominated X Tx U P HP).
We prove the intermediate claim HPui: ∀f x : set, f Px Xapply_fun f x unit_interval.
An exact proof term for the current goal is (partition_of_unity_family_unit_interval X Tx U P HP).
We prove the intermediate claim HPval_in_R: ∀f x : set, f Px Xapply_fun f x R.
Let f and x be given.
Assume HfP: f P.
Assume HxX: x X.
We prove the intermediate claim HxUI: apply_fun f x unit_interval.
An exact proof term for the current goal is (HPui f x HfP HxX).
An exact proof term for the current goal is (SepE1 R (λt : set¬ (Rlt t 0) ¬ (Rlt 1 t)) (apply_fun f x) HxUI).
We prove the intermediate claim HPval_nonneg: ∀f x : set, f Px XRle 0 (apply_fun f x).
Let f and x be given.
Assume HfP: f P.
Assume HxX: x X.
We prove the intermediate claim HxUI: apply_fun f x unit_interval.
An exact proof term for the current goal is (HPui f x HfP HxX).
We prove the intermediate claim Hcore: ¬ (Rlt (apply_fun f x) 0) ¬ (Rlt 1 (apply_fun f x)).
An exact proof term for the current goal is (SepE2 R (λt : set¬ (Rlt t 0) ¬ (Rlt 1 t)) (apply_fun f x) HxUI).
We prove the intermediate claim Hnlt: ¬ (Rlt (apply_fun f x) 0).
An exact proof term for the current goal is (andEL (¬ (Rlt (apply_fun f x) 0)) (¬ (Rlt 1 (apply_fun f x))) Hcore).
Apply (RleI 0 (apply_fun f x) real_0 (HPval_in_R f x HfP HxX)) to the current goal.
An exact proof term for the current goal is Hnlt.
Set u_of to be the term graph P (λf : setEps_i (λu : setu U support_of X Tx f u)).
We prove the intermediate claim Hu_of: ∀f : set, f Papply_fun u_of f U support_of X Tx f apply_fun u_of f.
Let f be given.
Assume HfP: f P.
Set u to be the term Eps_i (λu0 : setu0 U support_of X Tx f u0).
We prove the intermediate claim Hexu: ∃u0 : set, u0 U support_of X Tx f u0.
An exact proof term for the current goal is (HPdom f HfP).
We prove the intermediate claim Hu: u U support_of X Tx f u.
Apply Hexu to the current goal.
Let u0 be given.
Assume Hu0: u0 U support_of X Tx f u0.
An exact proof term for the current goal is (Eps_i_ax (λu1 : setu1 U support_of X Tx f u1) u0 Hu0).
We prove the intermediate claim Huapply: apply_fun u_of f = u.
rewrite the current goal using (apply_fun_graph P (λf0 : setEps_i (λu0 : setu0 U support_of X Tx f0 u0)) f HfP) (from left to right).
Use reflexivity.
rewrite the current goal using Huapply (from left to right).
An exact proof term for the current goal is Hu.
We prove the intermediate claim HUfinite_hits: ∀u : set, u U∃x : set, x X x u ∃S : set, finite S S C ∀A : set, A CA u EmptyA S.
Let u be given.
Assume HuU: u U.
An exact proof term for the current goal is (SepE2 Tx (λN : set∃x : set, x X x N ∃S : set, finite S S C ∀A : set, A CA N EmptyA S) u HuU).
Set S_of to be the term graph U (λu : setEps_i (λS : setfinite S S C ∀A : set, A CA u EmptyA S)).
We prove the intermediate claim HS_of: ∀u : set, u Ufinite (apply_fun S_of u) apply_fun S_of u C ∀A : set, A CA u EmptyA apply_fun S_of u.
Let u be given.
Assume HuU: u U.
Set Su to be the term Eps_i (λS : setfinite S S C ∀A : set, A CA u EmptyA S).
We prove the intermediate claim HexS: ∃S : set, finite S S C ∀A : set, A CA u EmptyA S.
Apply (HUfinite_hits u HuU) to the current goal.
Let x be given.
Assume Hxpack.
An exact proof term for the current goal is (andER (x X x u) (∃S : set, finite S S C ∀A : set, A CA u EmptyA S) Hxpack).
We prove the intermediate claim HSu: finite Su Su C ∀A : set, A CA u EmptyA Su.
Apply HexS to the current goal.
Let S be given.
Assume HS.
An exact proof term for the current goal is (Eps_i_ax (λS0 : setfinite S0 S0 C ∀A : set, A CA u EmptyA S0) S HS).
We prove the intermediate claim HSapply: apply_fun S_of u = Su.
rewrite the current goal using (apply_fun_graph U (λu0 : setEps_i (λS : setfinite S S C ∀A : set, A CA u0 EmptyA S)) u HuU) (from left to right).
Use reflexivity.
rewrite the current goal using HSapply (from left to right).
An exact proof term for the current goal is HSu.
We prove the intermediate claim HUepsVals_finite: ∀u : set, u Ufinite {apply_fun eps c|capply_fun S_of u}.
Let u be given.
Assume HuU: u U.
We prove the intermediate claim HSu_fin: finite (apply_fun S_of u).
An exact proof term for the current goal is (andEL (finite (apply_fun S_of u)) (apply_fun S_of u C) (andEL (finite (apply_fun S_of u) apply_fun S_of u C) (∀A : set, A CA u EmptyA apply_fun S_of u) (HS_of u HuU))).
An exact proof term for the current goal is (Repl_finite (λc : setapply_fun eps c) (apply_fun S_of u) HSu_fin).
Set r_of to be the term graph U (λu : setIf_i (apply_fun S_of u = Empty) 1 (Eps_i (λr : setSNo_min_of {apply_fun eps c|capply_fun S_of u} r))).
We prove the intermediate claim Hr_of_min: ∀u : set, u Uapply_fun S_of u EmptySNo_min_of {apply_fun eps c|capply_fun S_of u} (apply_fun r_of u).
Let u be given.
Assume HuU: u U.
Assume HSuNe: apply_fun S_of u Empty.
Set V to be the term {apply_fun eps c|capply_fun S_of u}.
We prove the intermediate claim HVfin: finite V.
An exact proof term for the current goal is (HUepsVals_finite u HuU).
We prove the intermediate claim HallS: ∀y : set, y VSNo y.
Let y be given.
Assume HyV: y V.
Apply (ReplE_impred (apply_fun S_of u) (λc : setapply_fun eps c) y HyV) to the current goal.
Let c be given.
Assume HcSu.
Assume HyEq.
rewrite the current goal using HyEq (from left to right).
We prove the intermediate claim HSu_subC: apply_fun S_of u C.
An exact proof term for the current goal is (andER (finite (apply_fun S_of u)) (apply_fun S_of u C) (andEL (finite (apply_fun S_of u) apply_fun S_of u C) (∀A : set, A CA u EmptyA apply_fun S_of u) (HS_of u HuU))).
We prove the intermediate claim HcC: c C.
An exact proof term for the current goal is (HSu_subC c HcSu).
We prove the intermediate claim Hepsc: apply_fun eps c R.
An exact proof term for the current goal is (andEL (apply_fun eps c R) (Rlt 0 (apply_fun eps c)) (Heps c HcC)).
An exact proof term for the current goal is (real_SNo (apply_fun eps c) Hepsc).
We prove the intermediate claim HVne0: V 0.
Assume HV0: V = 0.
We prove the intermediate claim Hexc: ∃c : set, c apply_fun S_of u.
An exact proof term for the current goal is (nonempty_has_element (apply_fun S_of u) HSuNe).
Apply Hexc to the current goal.
Let c be given.
Assume HcSu: c apply_fun S_of u.
We prove the intermediate claim HcV: apply_fun eps c V.
An exact proof term for the current goal is (ReplI (apply_fun S_of u) (λc0 : setapply_fun eps c0) c HcSu).
We prove the intermediate claim Hcin0: apply_fun eps c 0.
rewrite the current goal using HV0 (from right to left).
An exact proof term for the current goal is HcV.
An exact proof term for the current goal is (EmptyE (apply_fun eps c) Hcin0).
We prove the intermediate claim Hexm: ∃m : set, SNo_min_of V m.
An exact proof term for the current goal is (finite_min_exists V HallS HVfin HVne0).
rewrite the current goal using (apply_fun_graph U (λu0 : setIf_i (apply_fun S_of u0 = Empty) 1 (Eps_i (λr : setSNo_min_of {apply_fun eps c|capply_fun S_of u0} r))) u HuU) (from left to right).
rewrite the current goal using (If_i_0 (apply_fun S_of u = Empty) 1 (Eps_i (λr : setSNo_min_of V r)) HSuNe) (from left to right).
Apply Hexm to the current goal.
Let m be given.
Assume HmMin: SNo_min_of V m.
An exact proof term for the current goal is (Eps_i_ax (λr : setSNo_min_of V r) m HmMin).
We prove the intermediate claim Hr_of_le_on_S: ∀u c : set, u Uc apply_fun S_of uRle (apply_fun r_of u) (apply_fun eps c).
Let u and c be given.
Assume HuU: u U.
Assume HcSu: c apply_fun S_of u.
We prove the intermediate claim HSuNe: apply_fun S_of u Empty.
Assume HSu0: apply_fun S_of u = Empty.
We prove the intermediate claim HcinEmpty: c Empty.
rewrite the current goal using HSu0 (from right to left).
An exact proof term for the current goal is HcSu.
An exact proof term for the current goal is (EmptyE c HcinEmpty).
Set V to be the term {apply_fun eps c0|c0apply_fun S_of u}.
We prove the intermediate claim Hmin: SNo_min_of V (apply_fun r_of u).
An exact proof term for the current goal is (Hr_of_min u HuU HSuNe).
We prove the intermediate claim Hr_pair: apply_fun r_of u V SNo (apply_fun r_of u).
An exact proof term for the current goal is (andEL (apply_fun r_of u V SNo (apply_fun r_of u)) (∀yV, SNo yapply_fun r_of u y) Hmin).
We prove the intermediate claim HrS: SNo (apply_fun r_of u).
An exact proof term for the current goal is (andER (apply_fun r_of u V) (SNo (apply_fun r_of u)) Hr_pair).
We prove the intermediate claim Hprop: ∀yV, SNo yapply_fun r_of u y.
An exact proof term for the current goal is (andER (apply_fun r_of u V SNo (apply_fun r_of u)) (∀yV, SNo yapply_fun r_of u y) Hmin).
We prove the intermediate claim Hepsc_in_V: apply_fun eps c V.
An exact proof term for the current goal is (ReplI (apply_fun S_of u) (λc0 : setapply_fun eps c0) c HcSu).
We prove the intermediate claim HepscS: SNo (apply_fun eps c).
Apply (ReplE_impred (apply_fun S_of u) (λc0 : setapply_fun eps c0) (apply_fun eps c) Hepsc_in_V) to the current goal.
Let c0 be given.
Assume Hc0Su.
Assume Heq.
rewrite the current goal using Heq (from left to right).
We prove the intermediate claim HSu_subC: apply_fun S_of u C.
An exact proof term for the current goal is (andER (finite (apply_fun S_of u)) (apply_fun S_of u C) (andEL (finite (apply_fun S_of u) apply_fun S_of u C) (∀A : set, A CA u EmptyA apply_fun S_of u) (HS_of u HuU))).
We prove the intermediate claim Hc0C: c0 C.
An exact proof term for the current goal is (HSu_subC c0 Hc0Su).
We prove the intermediate claim Hepsc0R: apply_fun eps c0 R.
An exact proof term for the current goal is (andEL (apply_fun eps c0 R) (Rlt 0 (apply_fun eps c0)) (Heps c0 Hc0C)).
An exact proof term for the current goal is (real_SNo (apply_fun eps c0) Hepsc0R).
We prove the intermediate claim HrleSNo: apply_fun r_of u apply_fun eps c.
An exact proof term for the current goal is (Hprop (apply_fun eps c) Hepsc_in_V HepscS).
We prove the intermediate claim HrR: apply_fun r_of u R.
We prove the intermediate claim HrInV: apply_fun r_of u V.
An exact proof term for the current goal is (andEL (apply_fun r_of u V) (SNo (apply_fun r_of u)) Hr_pair).
Apply (ReplE_impred (apply_fun S_of u) (λc0 : setapply_fun eps c0) (apply_fun r_of u) HrInV) to the current goal.
Let c0 be given.
Assume Hc0Su.
Assume Heq.
rewrite the current goal using Heq (from left to right).
We prove the intermediate claim HSu_subC: apply_fun S_of u C.
An exact proof term for the current goal is (andER (finite (apply_fun S_of u)) (apply_fun S_of u C) (andEL (finite (apply_fun S_of u) apply_fun S_of u C) (∀A : set, A CA u EmptyA apply_fun S_of u) (HS_of u HuU))).
We prove the intermediate claim Hc0C: c0 C.
An exact proof term for the current goal is (HSu_subC c0 Hc0Su).
An exact proof term for the current goal is (andEL (apply_fun eps c0 R) (Rlt 0 (apply_fun eps c0)) (Heps c0 Hc0C)).
We prove the intermediate claim HepscR: apply_fun eps c R.
We prove the intermediate claim HSu_subC: apply_fun S_of u C.
An exact proof term for the current goal is (andER (finite (apply_fun S_of u)) (apply_fun S_of u C) (andEL (finite (apply_fun S_of u) apply_fun S_of u C) (∀A : set, A CA u EmptyA apply_fun S_of u) (HS_of u HuU))).
We prove the intermediate claim HcC: c C.
An exact proof term for the current goal is (HSu_subC c HcSu).
An exact proof term for the current goal is (andEL (apply_fun eps c R) (Rlt 0 (apply_fun eps c)) (Heps c HcC)).
Apply (RleI (apply_fun r_of u) (apply_fun eps c) HrR HepscR) to the current goal.
Assume Hlt: Rlt (apply_fun eps c) (apply_fun r_of u).
We prove the intermediate claim HltS: apply_fun eps c < apply_fun r_of u.
An exact proof term for the current goal is (RltE_lt (apply_fun eps c) (apply_fun r_of u) Hlt).
We prove the intermediate claim Hepsle_r: apply_fun eps c apply_fun r_of u.
An exact proof term for the current goal is (SNoLtLe (apply_fun eps c) (apply_fun r_of u) HltS).
We prove the intermediate claim Heq: apply_fun r_of u = apply_fun eps c.
An exact proof term for the current goal is (SNoLe_antisym (apply_fun r_of u) (apply_fun eps c) HrS HepscS HrleSNo Hepsle_r).
We prove the intermediate claim Hbad: apply_fun eps c < apply_fun eps c.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is HltS.
An exact proof term for the current goal is ((SNoLt_irref (apply_fun eps c)) Hbad).
We prove the intermediate claim Hr_of_le_on_hits: ∀u A : set, u UA CA u EmptyRle (apply_fun r_of u) (apply_fun eps A).
Let u and A be given.
Assume HuU: u U.
Assume HA: A C.
Assume Hmeet: A u Empty.
We prove the intermediate claim HAinSu: A apply_fun S_of u.
We prove the intermediate claim HSuProp: ∀B : set, B CB u EmptyB apply_fun S_of u.
An exact proof term for the current goal is (andER (finite (apply_fun S_of u) apply_fun S_of u C) (∀B : set, B CB u EmptyB apply_fun S_of u) (HS_of u HuU)).
An exact proof term for the current goal is (HSuProp A HA Hmeet).
An exact proof term for the current goal is (Hr_of_le_on_S u A HuU HAinSu).
We prove the intermediate claim Hr_of_pos: ∀u : set, u URlt 0 (apply_fun r_of u).
Let u be given.
Assume HuU: u U.
Apply (xm (apply_fun S_of u = Empty)) to the current goal.
Assume HSu0: apply_fun S_of u = Empty.
rewrite the current goal using (apply_fun_graph U (λu0 : setIf_i (apply_fun S_of u0 = Empty) 1 (Eps_i (λr : setSNo_min_of {apply_fun eps c|capply_fun S_of u0} r))) u HuU) (from left to right).
rewrite the current goal using (If_i_1 (apply_fun S_of u = Empty) 1 (Eps_i (λr : setSNo_min_of {apply_fun eps c|capply_fun S_of u} r)) HSu0) (from left to right).
An exact proof term for the current goal is Rlt_0_1.
Assume HSuNe: ¬ (apply_fun S_of u = Empty).
Set V to be the term {apply_fun eps c|capply_fun S_of u}.
We prove the intermediate claim Hmin: SNo_min_of V (apply_fun r_of u).
An exact proof term for the current goal is (Hr_of_min u HuU HSuNe).
We prove the intermediate claim HrPair: apply_fun r_of u V SNo (apply_fun r_of u).
An exact proof term for the current goal is (andEL (apply_fun r_of u V SNo (apply_fun r_of u)) (∀yV, SNo yapply_fun r_of u y) Hmin).
We prove the intermediate claim HrInV: apply_fun r_of u V.
An exact proof term for the current goal is (andEL (apply_fun r_of u V) (SNo (apply_fun r_of u)) HrPair).
Apply (ReplE_impred (apply_fun S_of u) (λc0 : setapply_fun eps c0) (apply_fun r_of u) HrInV) to the current goal.
Let c0 be given.
Assume Hc0Su.
Assume Heq.
rewrite the current goal using Heq (from left to right).
We prove the intermediate claim HSu_subC: apply_fun S_of u C.
An exact proof term for the current goal is (andER (finite (apply_fun S_of u)) (apply_fun S_of u C) (andEL (finite (apply_fun S_of u) apply_fun S_of u C) (∀B : set, B CB u EmptyB apply_fun S_of u) (HS_of u HuU))).
We prove the intermediate claim Hc0C: c0 C.
An exact proof term for the current goal is (HSu_subC c0 Hc0Su).
An exact proof term for the current goal is (andER (apply_fun eps c0 R) (Rlt 0 (apply_fun eps c0)) (Heps c0 Hc0C)).
Set coef_of to be the term graph P (λf0 : setapply_fun r_of (apply_fun u_of f0)).
We prove the intermediate claim Hcoef_pos: ∀f : set, f PRlt 0 (apply_fun coef_of f).
Let f be given.
Assume HfP: f P.
rewrite the current goal using (apply_fun_graph P (λf0 : setapply_fun r_of (apply_fun u_of f0)) f HfP) (from left to right).
We prove the intermediate claim HuU: apply_fun u_of f U.
An exact proof term for the current goal is (andEL (apply_fun u_of f U) (support_of X Tx f apply_fun u_of f) (Hu_of f HfP)).
An exact proof term for the current goal is (Hr_of_pos (apply_fun u_of f) HuU).
We prove the intermediate claim Hnonzero_in_support: ∀f x : set, f Px Xapply_fun f x 0x support_of X Tx f.
Let f and x be given.
Assume HfP: f P.
Assume HxX: x X.
Assume Hnx0: apply_fun f x 0.
Set A0 to be the term {zX|apply_fun f z 0}.
We prove the intermediate claim HxA0: x A0.
An exact proof term for the current goal is (SepI X (λz : setapply_fun f z 0) x HxX Hnx0).
We prove the intermediate claim HA0subX: A0 X.
An exact proof term for the current goal is (Sep_Subq X (λz : setapply_fun f z 0)).
We prove the intermediate claim HA0subCl: A0 closure_of X Tx A0.
An exact proof term for the current goal is (closure_contains_set X Tx A0 HTx HA0subX).
An exact proof term for the current goal is (HA0subCl x HxA0).
We prove the intermediate claim Hu_of_meets: ∀f A x : set, f PA Cx Xx Aapply_fun f x 0A (apply_fun u_of f) Empty.
Let f, A and x be given.
Assume HfP: f P.
Assume HA: A C.
Assume HxX: x X.
Assume HxA: x A.
Assume Hnx0: apply_fun f x 0.
We prove the intermediate claim HxSupp: x support_of X Tx f.
An exact proof term for the current goal is (Hnonzero_in_support f x HfP HxX Hnx0).
We prove the intermediate claim HuPair: apply_fun u_of f U support_of X Tx f apply_fun u_of f.
An exact proof term for the current goal is (Hu_of f HfP).
We prove the intermediate claim HSuppSubU: support_of X Tx f apply_fun u_of f.
An exact proof term for the current goal is (andER (apply_fun u_of f U) (support_of X Tx f apply_fun u_of f) HuPair).
We prove the intermediate claim HxU: x apply_fun u_of f.
An exact proof term for the current goal is (HSuppSubU x HxSupp).
Assume Hcap0: A (apply_fun u_of f) = Empty.
We prove the intermediate claim HxCap: x A (apply_fun u_of f).
An exact proof term for the current goal is (binintersectI A (apply_fun u_of f) x HxA HxU).
We prove the intermediate claim HxEmpty: x Empty.
rewrite the current goal using Hcap0 (from right to left).
An exact proof term for the current goal is HxCap.
An exact proof term for the current goal is (EmptyE x HxEmpty).
We prove the intermediate claim Hcoef_le_on_point: ∀f A x : set, f PA Cx Xx Aapply_fun f x 0Rle (apply_fun coef_of f) (apply_fun eps A).
Let f, A and x be given.
Assume HfP: f P.
Assume HA: A C.
Assume HxX: x X.
Assume HxA: x A.
Assume Hnx0: apply_fun f x 0.
rewrite the current goal using (apply_fun_graph P (λf0 : setapply_fun r_of (apply_fun u_of f0)) f HfP) (from left to right).
We prove the intermediate claim HuPair: apply_fun u_of f U support_of X Tx f apply_fun u_of f.
An exact proof term for the current goal is (Hu_of f HfP).
We prove the intermediate claim HuU: apply_fun u_of f U.
An exact proof term for the current goal is (andEL (apply_fun u_of f U) (support_of X Tx f apply_fun u_of f) HuPair).
We prove the intermediate claim Hmeet: A (apply_fun u_of f) Empty.
An exact proof term for the current goal is (Hu_of_meets f A x HfP HA HxX HxA Hnx0).
An exact proof term for the current goal is (Hr_of_le_on_hits (apply_fun u_of f) A HuU HA Hmeet).
Set weighted_step to be the term λx : setλe : setλk acc : setadd_SNo acc (mul_SNo (apply_fun coef_of (apply_fun e k)) (apply_fun (apply_fun e k) x)).
Set weighted_sum to be the term λx : setλn e : setnat_primrec 0 (weighted_step x e) n.
We prove the intermediate claim weighted_sum_0: ∀x e : set, weighted_sum x 0 e = 0.
Let x and e be given.
We prove the intermediate claim Hdef: weighted_sum x 0 e = nat_primrec 0 (weighted_step x e) 0.
Use reflexivity.
rewrite the current goal using Hdef (from left to right).
An exact proof term for the current goal is (nat_primrec_0 0 (weighted_step x e)).
We prove the intermediate claim weighted_sum_S: ∀x e n : set, nat_p nweighted_sum x (ordsucc n) e = weighted_step x e n (weighted_sum x n e).
Let x, e and n be given.
Assume HnNat: nat_p n.
We prove the intermediate claim HdefS: weighted_sum x (ordsucc n) e = nat_primrec 0 (weighted_step x e) (ordsucc n).
Use reflexivity.
rewrite the current goal using HdefS (from left to right).
We prove the intermediate claim HprimS: nat_primrec 0 (weighted_step x e) (ordsucc n) = weighted_step x e n (nat_primrec 0 (weighted_step x e) n).
An exact proof term for the current goal is (nat_primrec_S 0 (weighted_step x e) n HnNat).
rewrite the current goal using HprimS (from left to right).
Use reflexivity.
We prove the intermediate claim weighted_step_congr_acc: ∀x e k acc1 acc2 : set, acc1 = acc2weighted_step x e k acc1 = weighted_step x e k acc2.
Let x, e, k, acc1 and acc2 be given.
Assume Hacc: acc1 = acc2.
rewrite the current goal using Hacc (from left to right).
Use reflexivity.
We prove the intermediate claim weighted_step_congr_e_at: ∀x e1 e2 k acc : set, apply_fun e1 k = apply_fun e2 kweighted_step x e1 k acc = weighted_step x e2 k acc.
Let x, e1, e2, k and acc be given.
Assume Heq: apply_fun e1 k = apply_fun e2 k.
We prove the intermediate claim Hdef1: weighted_step x e1 k acc = add_SNo acc (mul_SNo (apply_fun coef_of (apply_fun e1 k)) (apply_fun (apply_fun e1 k) x)).
Use reflexivity.
We prove the intermediate claim Hdef2: weighted_step x e2 k acc = add_SNo acc (mul_SNo (apply_fun coef_of (apply_fun e2 k)) (apply_fun (apply_fun e2 k) x)).
Use reflexivity.
rewrite the current goal using Hdef1 (from left to right).
rewrite the current goal using Hdef2 (from left to right).
rewrite the current goal using Heq (from left to right).
Use reflexivity.
Set swap_last_two to be the term λe m : setgraph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i).
We prove the intermediate claim swap_last_two_apply: ∀e m i : set, i ordsucc (ordsucc m)apply_fun (swap_last_two e m) i = if i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i.
Let e, m and i be given.
Assume HiDom: i ordsucc (ordsucc m).
We prove the intermediate claim Hdef: swap_last_two e m = graph (ordsucc (ordsucc m)) (λj : setif j = m then apply_fun e (ordsucc m) else if j = ordsucc m then apply_fun e m else apply_fun e j).
Use reflexivity.
rewrite the current goal using Hdef (from left to right).
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λj : setif j = m then apply_fun e (ordsucc m) else if j = ordsucc m then apply_fun e m else apply_fun e j) i HiDom) (from left to right).
Use reflexivity.
Set swap_adjacent to be the term λe i n : setgraph n (λj : setif j = i then apply_fun e (ordsucc i) else if j = ordsucc i then apply_fun e i else apply_fun e j).
We prove the intermediate claim swap_adjacent_apply: ∀e i n j : set, j napply_fun (swap_adjacent e i n) j = if j = i then apply_fun e (ordsucc i) else if j = ordsucc i then apply_fun e i else apply_fun e j.
Let e, i, n and j be given.
Assume HjDom: j n.
We prove the intermediate claim Hdef: swap_adjacent e i n = graph n (λk : setif k = i then apply_fun e (ordsucc i) else if k = ordsucc i then apply_fun e i else apply_fun e k).
Use reflexivity.
rewrite the current goal using Hdef (from left to right).
rewrite the current goal using (apply_fun_graph n (λk : setif k = i then apply_fun e (ordsucc i) else if k = ordsucc i then apply_fun e i else apply_fun e k) j HjDom) (from left to right).
Use reflexivity.
We prove the intermediate claim swap_adjacent_at_succ: ∀e i n : set, ordsucc i napply_fun (swap_adjacent e i n) (ordsucc i) = apply_fun e i.
Let e, i and n be given.
Assume HsiDom: ordsucc i n.
We prove the intermediate claim Hsa: apply_fun (swap_adjacent e i n) (ordsucc i) = if ordsucc i = i then apply_fun e (ordsucc i) else if ordsucc i = ordsucc i then apply_fun e i else apply_fun e (ordsucc i).
An exact proof term for the current goal is (swap_adjacent_apply e i n (ordsucc i) HsiDom).
rewrite the current goal using Hsa (from left to right).
We prove the intermediate claim Hneq: ¬ (ordsucc i = i).
Assume Heq: ordsucc i = i.
We prove the intermediate claim Hii: i i.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 i).
An exact proof term for the current goal is ((In_irref i) Hii).
rewrite the current goal using (If_i_0 (ordsucc i = i) (apply_fun e (ordsucc i)) (if ordsucc i = ordsucc i then apply_fun e i else apply_fun e (ordsucc i)) Hneq) (from left to right).
We prove the intermediate claim Hrefl: ordsucc i = ordsucc i.
Use reflexivity.
rewrite the current goal using (If_i_1 (ordsucc i = ordsucc i) (apply_fun e i) (apply_fun e (ordsucc i)) Hrefl) (from left to right).
Use reflexivity.
We prove the intermediate claim function_on_swap_adjacent: ∀F e i n : set, i nordsucc i nfunction_on e n Ffunction_on (swap_adjacent e i n) n F.
Let F, e, i and n be given.
Assume HiDom: i n.
Assume HsiDom: ordsucc i n.
Assume HeFun: function_on e n F.
Let j be given.
Assume HjDom: j n.
We will prove apply_fun (swap_adjacent e i n) j F.
We prove the intermediate claim Heq: apply_fun (swap_adjacent e i n) j = if j = i then apply_fun e (ordsucc i) else if j = ordsucc i then apply_fun e i else apply_fun e j.
An exact proof term for the current goal is (swap_adjacent_apply e i n j HjDom).
We prove the intermediate claim Hsubst: ∀S T : set, S = TT FS F.
Let S and T be given.
Assume HeqST: S = T.
Assume HT: T F.
rewrite the current goal using HeqST (from left to right).
An exact proof term for the current goal is HT.
We prove the intermediate claim HT: (if j = i then apply_fun e (ordsucc i) else if j = ordsucc i then apply_fun e i else apply_fun e j) F.
Apply (xm (j = i)) to the current goal.
Assume Hji: j = i.
rewrite the current goal using (If_i_1 (j = i) (apply_fun e (ordsucc i)) (if j = ordsucc i then apply_fun e i else apply_fun e j) Hji) (from left to right).
An exact proof term for the current goal is (HeFun (ordsucc i) HsiDom).
Assume Hnji: ¬ (j = i).
rewrite the current goal using (If_i_0 (j = i) (apply_fun e (ordsucc i)) (if j = ordsucc i then apply_fun e i else apply_fun e j) Hnji) (from left to right).
Apply (xm (j = ordsucc i)) to the current goal.
Assume Hjsi: j = ordsucc i.
rewrite the current goal using (If_i_1 (j = ordsucc i) (apply_fun e i) (apply_fun e j) Hjsi) (from left to right).
An exact proof term for the current goal is (HeFun i HiDom).
Assume Hnjsi: ¬ (j = ordsucc i).
rewrite the current goal using (If_i_0 (j = ordsucc i) (apply_fun e i) (apply_fun e j) Hnjsi) (from left to right).
An exact proof term for the current goal is (HeFun j HjDom).
An exact proof term for the current goal is (Hsubst (apply_fun (swap_adjacent e i n) j) (if j = i then apply_fun e (ordsucc i) else if j = ordsucc i then apply_fun e i else apply_fun e j) Heq HT).
We prove the intermediate claim bijection_swap_adjacent: ∀F e i n : set, i nordsucc i nbijection n F ebijection n F (swap_adjacent e i n).
Let F, e, i and n be given.
Assume HiDom: i n.
Assume HsiDom: ordsucc i n.
Assume Hbij: bijection n F e.
We prove the intermediate claim HeFun: function_on e n F.
An exact proof term for the current goal is (andEL (function_on e n F) (∀y : set, y F∃x0 : set, x0 n apply_fun e x0 = y (∀x' : set, x' napply_fun e x' = yx' = x0)) Hbij).
We prove the intermediate claim Huniq: ∀y : set, y F∃x0 : set, x0 n apply_fun e x0 = y (∀x' : set, x' napply_fun e x' = yx' = x0).
An exact proof term for the current goal is (andER (function_on e n F) (∀y : set, y F∃x0 : set, x0 n apply_fun e x0 = y (∀x' : set, x' napply_fun e x' = yx' = x0)) Hbij).
We will prove function_on (swap_adjacent e i n) n F (∀y : set, y F∃x0 : set, x0 n apply_fun (swap_adjacent e i n) x0 = y (∀x' : set, x' napply_fun (swap_adjacent e i n) x' = yx' = x0)).
Apply andI to the current goal.
An exact proof term for the current goal is (function_on_swap_adjacent F e i n HiDom HsiDom HeFun).
Let y be given.
Assume HyF: y F.
Apply (Huniq y HyF) to the current goal.
Let x0 be given.
Assume Hx0pack.
We prove the intermediate claim Hx0AB: x0 n apply_fun e x0 = y.
An exact proof term for the current goal is (andEL (x0 n apply_fun e x0 = y) (∀x' : set, x' napply_fun e x' = yx' = x0) Hx0pack).
We prove the intermediate claim Hx0Dom: x0 n.
An exact proof term for the current goal is (andEL (x0 n) (apply_fun e x0 = y) Hx0AB).
We prove the intermediate claim Hex0: apply_fun e x0 = y.
An exact proof term for the current goal is (andER (x0 n) (apply_fun e x0 = y) Hx0AB).
Set x1 to be the term If_i (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0).
We prove the intermediate claim Hx1Def: x1 = If_i (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0).
Use reflexivity.
We prove the intermediate claim Hx1Dom: x1 n.
rewrite the current goal using Hx1Def (from left to right) at position 1.
Apply (xm (x0 = i)) to the current goal.
Assume Hx0i: x0 = i.
rewrite the current goal using (If_i_1 (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0) Hx0i) (from left to right).
An exact proof term for the current goal is HsiDom.
Assume Hx0ni: ¬ (x0 = i).
rewrite the current goal using (If_i_0 (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0) Hx0ni) (from left to right).
Apply (xm (x0 = ordsucc i)) to the current goal.
Assume Hx0si: x0 = ordsucc i.
rewrite the current goal using (If_i_1 (x0 = ordsucc i) i x0 Hx0si) (from left to right).
An exact proof term for the current goal is HiDom.
Assume Hx0nsi: ¬ (x0 = ordsucc i).
rewrite the current goal using (If_i_0 (x0 = ordsucc i) i x0 Hx0nsi) (from left to right).
An exact proof term for the current goal is Hx0Dom.
We prove the intermediate claim Hx1Eq: apply_fun (swap_adjacent e i n) x1 = y.
We prove the intermediate claim Hsa: apply_fun (swap_adjacent e i n) x1 = if x1 = i then apply_fun e (ordsucc i) else if x1 = ordsucc i then apply_fun e i else apply_fun e x1.
An exact proof term for the current goal is (swap_adjacent_apply e i n x1 Hx1Dom).
rewrite the current goal using Hsa (from left to right).
rewrite the current goal using Hx1Def (from left to right) at position 1.
Apply (xm (x0 = i)) to the current goal.
Assume Hx0i: x0 = i.
rewrite the current goal using (If_i_1 (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0) Hx0i) (from left to right).
We prove the intermediate claim Hneq: ¬ (ordsucc i = i).
Assume Heq: ordsucc i = i.
We prove the intermediate claim HiIn: i i.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 i).
An exact proof term for the current goal is ((In_irref i) HiIn).
rewrite the current goal using (If_i_0 (ordsucc i = i) (apply_fun e (ordsucc i)) (if ordsucc i = ordsucc i then apply_fun e i else apply_fun e (ordsucc i)) Hneq) (from left to right).
We prove the intermediate claim Hrefl: ordsucc i = ordsucc i.
Use reflexivity.
rewrite the current goal using (If_i_1 (ordsucc i = ordsucc i) (apply_fun e i) (apply_fun e (ordsucc i)) Hrefl) (from left to right).
rewrite the current goal using Hx0i (from right to left) at position 1.
An exact proof term for the current goal is Hex0.
Assume Hx0ni: ¬ (x0 = i).
rewrite the current goal using (If_i_0 (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0) Hx0ni) (from left to right).
Apply (xm (x0 = ordsucc i)) to the current goal.
Assume Hx0si: x0 = ordsucc i.
rewrite the current goal using (If_i_1 (x0 = ordsucc i) i x0 Hx0si) (from left to right).
We prove the intermediate claim Hii: i = i.
Use reflexivity.
rewrite the current goal using (If_i_1 (i = i) (apply_fun e (ordsucc i)) (if i = ordsucc i then apply_fun e i else apply_fun e i) Hii) (from left to right).
rewrite the current goal using Hx0si (from right to left) at position 1.
An exact proof term for the current goal is Hex0.
Assume Hx0nsi: ¬ (x0 = ordsucc i).
rewrite the current goal using (If_i_0 (x0 = ordsucc i) i x0 Hx0nsi) (from left to right).
rewrite the current goal using (If_i_0 (x0 = i) (apply_fun e (ordsucc i)) (if x0 = ordsucc i then apply_fun e i else apply_fun e x0) Hx0ni) (from left to right).
rewrite the current goal using (If_i_0 (x0 = ordsucc i) (apply_fun e i) (apply_fun e x0) Hx0nsi) (from left to right).
An exact proof term for the current goal is Hex0.
We use x1 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 Hx1Dom.
An exact proof term for the current goal is Hx1Eq.
Let x' be given.
Assume Hx'Dom: x' n.
Assume HsxEq: apply_fun (swap_adjacent e i n) x' = y.
We will prove x' = x1.
We prove the intermediate claim Hx0Uniq: ∀z : set, z napply_fun e z = yz = x0.
An exact proof term for the current goal is (andER (x0 n apply_fun e x0 = y) (∀x' : set, x' napply_fun e x' = yx' = x0) Hx0pack).
Set x2 to be the term If_i (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x').
We prove the intermediate claim Hx2Def: x2 = If_i (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x').
Use reflexivity.
We prove the intermediate claim Hx2Dom: x2 n.
rewrite the current goal using Hx2Def (from left to right) at position 1.
Apply (xm (x' = i)) to the current goal.
Assume Hx'i: x' = i.
rewrite the current goal using (If_i_1 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'i) (from left to right).
An exact proof term for the current goal is HsiDom.
Assume Hx'ni: ¬ (x' = i).
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
Apply (xm (x' = ordsucc i)) to the current goal.
Assume Hx'si: x' = ordsucc i.
rewrite the current goal using (If_i_1 (x' = ordsucc i) i x' Hx'si) (from left to right).
An exact proof term for the current goal is HiDom.
Assume Hx'nsi: ¬ (x' = ordsucc i).
rewrite the current goal using (If_i_0 (x' = ordsucc i) i x' Hx'nsi) (from left to right).
An exact proof term for the current goal is Hx'Dom.
We prove the intermediate claim Hsa': apply_fun (swap_adjacent e i n) x' = if x' = i then apply_fun e (ordsucc i) else if x' = ordsucc i then apply_fun e i else apply_fun e x'.
An exact proof term for the current goal is (swap_adjacent_apply e i n x' Hx'Dom).
We prove the intermediate claim HifEq: (if x' = i then apply_fun e (ordsucc i) else if x' = ordsucc i then apply_fun e i else apply_fun e x') = y.
rewrite the current goal using Hsa' (from right to left) at position 1.
An exact proof term for the current goal is HsxEq.
We prove the intermediate claim Hx2Ey: apply_fun e x2 = y.
Apply (xm (x' = i)) to the current goal.
Assume Hx'i: x' = i.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_1 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'i) (from left to right).
rewrite the current goal using (If_i_1 (x' = i) (apply_fun e (ordsucc i)) (if x' = ordsucc i then apply_fun e i else apply_fun e x') Hx'i) (from right to left) at position 1.
An exact proof term for the current goal is HifEq.
Assume Hx'ni: ¬ (x' = i).
Apply (xm (x' = ordsucc i)) to the current goal.
Assume Hx'si: x' = ordsucc i.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
rewrite the current goal using (If_i_1 (x' = ordsucc i) i x' Hx'si) (from left to right).
rewrite the current goal using (If_i_1 (x' = ordsucc i) (apply_fun e i) (apply_fun e x') Hx'si) (from right to left) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (apply_fun e (ordsucc i)) (if x' = ordsucc i then apply_fun e i else apply_fun e x') Hx'ni) (from right to left) at position 1.
An exact proof term for the current goal is HifEq.
Assume Hx'nsi: ¬ (x' = ordsucc i).
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
rewrite the current goal using (If_i_0 (x' = ordsucc i) i x' Hx'nsi) (from left to right).
rewrite the current goal using (If_i_0 (x' = ordsucc i) (apply_fun e i) (apply_fun e x') Hx'nsi) (from right to left) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (apply_fun e (ordsucc i)) (if x' = ordsucc i then apply_fun e i else apply_fun e x') Hx'ni) (from right to left) at position 1.
An exact proof term for the current goal is HifEq.
We prove the intermediate claim Hx2x0: x2 = x0.
An exact proof term for the current goal is (Hx0Uniq x2 Hx2Dom Hx2Ey).
We prove the intermediate claim Hneqsi: ¬ (ordsucc i = i).
Assume Heq: ordsucc i = i.
We prove the intermediate claim HiIn: i i.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 i).
An exact proof term for the current goal is ((In_irref i) HiIn).
Apply (xm (x0 = i)) to the current goal.
Assume Hx0i: x0 = i.
rewrite the current goal using Hx1Def (from left to right) at position 1.
rewrite the current goal using (If_i_1 (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0) Hx0i) (from left to right) at position 1.
We prove the intermediate claim Hx2i: x2 = i.
rewrite the current goal using Hx2x0 (from left to right) at position 1.
An exact proof term for the current goal is Hx0i.
Apply (xm (x' = ordsucc i)) to the current goal.
Assume Hx'si: x' = ordsucc i.
An exact proof term for the current goal is Hx'si.
Assume Hx'nsi: ¬ (x' = ordsucc i).
Apply FalseE to the current goal.
Apply (xm (x' = i)) to the current goal.
Assume Hx'i: x' = i.
We prove the intermediate claim Hx2si: x2 = ordsucc i.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_1 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'i) (from left to right).
Use reflexivity.
We prove the intermediate claim HsiEq: ordsucc i = i.
rewrite the current goal using Hx2si (from right to left) at position 1.
An exact proof term for the current goal is Hx2i.
An exact proof term for the current goal is (Hneqsi HsiEq).
Assume Hx'ni: ¬ (x' = i).
We prove the intermediate claim Hx2Eqx': x2 = x'.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
rewrite the current goal using (If_i_0 (x' = ordsucc i) i x' Hx'nsi) (from left to right).
Use reflexivity.
We prove the intermediate claim Hx'i: x' = i.
rewrite the current goal using Hx2Eqx' (from right to left) at position 1.
An exact proof term for the current goal is Hx2i.
An exact proof term for the current goal is (Hx'ni Hx'i).
Assume Hx0ni: ¬ (x0 = i).
Apply (xm (x0 = ordsucc i)) to the current goal.
Assume Hx0si: x0 = ordsucc i.
rewrite the current goal using Hx1Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0) Hx0ni) (from left to right) at position 1.
rewrite the current goal using (If_i_1 (x0 = ordsucc i) i x0 Hx0si) (from left to right) at position 1.
We prove the intermediate claim Hx2si: x2 = ordsucc i.
rewrite the current goal using Hx2x0 (from left to right) at position 1.
An exact proof term for the current goal is Hx0si.
Apply (xm (x' = i)) to the current goal.
Assume Hx'i: x' = i.
An exact proof term for the current goal is Hx'i.
Assume Hx'ni: ¬ (x' = i).
Apply FalseE to the current goal.
Apply (xm (x' = ordsucc i)) to the current goal.
Assume Hx'si: x' = ordsucc i.
We prove the intermediate claim Hx2i: x2 = i.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
rewrite the current goal using (If_i_1 (x' = ordsucc i) i x' Hx'si) (from left to right).
Use reflexivity.
We prove the intermediate claim HsiEq: ordsucc i = i.
rewrite the current goal using Hx2si (from right to left) at position 1.
An exact proof term for the current goal is Hx2i.
An exact proof term for the current goal is (Hneqsi HsiEq).
Assume Hx'nsi: ¬ (x' = ordsucc i).
We prove the intermediate claim Hx2Eqx': x2 = x'.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
rewrite the current goal using (If_i_0 (x' = ordsucc i) i x' Hx'nsi) (from left to right).
Use reflexivity.
We prove the intermediate claim Hx'si2: x' = ordsucc i.
rewrite the current goal using Hx2Eqx' (from right to left) at position 1.
An exact proof term for the current goal is Hx2si.
An exact proof term for the current goal is (Hx'nsi Hx'si2).
Assume Hx0nsi: ¬ (x0 = ordsucc i).
rewrite the current goal using Hx1Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x0 = i) (ordsucc i) (If_i (x0 = ordsucc i) i x0) Hx0ni) (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x0 = ordsucc i) i x0 Hx0nsi) (from left to right) at position 1.
Apply (xm (x' = i)) to the current goal.
Assume Hx'i: x' = i.
Apply FalseE to the current goal.
We prove the intermediate claim Hx2si: x2 = ordsucc i.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_1 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'i) (from left to right).
Use reflexivity.
We prove the intermediate claim Hx0si: x0 = ordsucc i.
rewrite the current goal using Hx2x0 (from right to left) at position 1.
An exact proof term for the current goal is Hx2si.
An exact proof term for the current goal is (Hx0nsi Hx0si).
Assume Hx'ni: ¬ (x' = i).
Apply (xm (x' = ordsucc i)) to the current goal.
Assume Hx'si: x' = ordsucc i.
Apply FalseE to the current goal.
We prove the intermediate claim Hx2i: x2 = i.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
rewrite the current goal using (If_i_1 (x' = ordsucc i) i x' Hx'si) (from left to right).
Use reflexivity.
We prove the intermediate claim Hx0i: x0 = i.
rewrite the current goal using Hx2x0 (from right to left) at position 1.
An exact proof term for the current goal is Hx2i.
An exact proof term for the current goal is (Hx0ni Hx0i).
Assume Hx'nsi: ¬ (x' = ordsucc i).
We prove the intermediate claim Hx2Eqx': x2 = x'.
rewrite the current goal using Hx2Def (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x' = i) (ordsucc i) (If_i (x' = ordsucc i) i x') Hx'ni) (from left to right).
rewrite the current goal using (If_i_0 (x' = ordsucc i) i x' Hx'nsi) (from left to right).
Use reflexivity.
rewrite the current goal using Hx2Eqx' (from right to left) at position 1.
An exact proof term for the current goal is Hx2x0.
We prove the intermediate claim function_on_swap_last_two: ∀F e m : set, nat_p mfunction_on e (ordsucc (ordsucc m)) Ffunction_on (swap_last_two e m) (ordsucc (ordsucc m)) F.
Let F, e and m be given.
Assume HmNat: nat_p m.
Assume HeFun: function_on e (ordsucc (ordsucc m)) F.
Let i be given.
Assume HiDom: i ordsucc (ordsucc m).
We will prove apply_fun (swap_last_two e m) i F.
We prove the intermediate claim Hdef: swap_last_two e m = graph (ordsucc (ordsucc m)) (λj : setif j = m then apply_fun e (ordsucc m) else if j = ordsucc m then apply_fun e m else apply_fun e j).
Use reflexivity.
rewrite the current goal using Hdef (from left to right) at position 1.
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λj : setif j = m then apply_fun e (ordsucc m) else if j = ordsucc m then apply_fun e m else apply_fun e j) i HiDom) (from left to right).
Apply (xm (i = m)) to the current goal.
Assume Him: i = m.
rewrite the current goal using (If_i_1 (i = m) (apply_fun e (ordsucc m)) (if i = ordsucc m then apply_fun e m else apply_fun e i) Him) (from left to right).
We prove the intermediate claim HsmDom: ordsucc m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI2 (ordsucc m)).
An exact proof term for the current goal is (HeFun (ordsucc m) HsmDom).
Assume Hnim: ¬ (i = m).
rewrite the current goal using (If_i_0 (i = m) (apply_fun e (ordsucc m)) (if i = ordsucc m then apply_fun e m else apply_fun e i) Hnim) (from left to right).
Apply (xm (i = ordsucc m)) to the current goal.
Assume Hism: i = ordsucc m.
rewrite the current goal using (If_i_1 (i = ordsucc m) (apply_fun e m) (apply_fun e i) Hism) (from left to right).
We prove the intermediate claim HmDom: m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI1 (ordsucc m) m (ordsuccI2 m)).
An exact proof term for the current goal is (HeFun m HmDom).
Assume Hnism: ¬ (i = ordsucc m).
rewrite the current goal using (If_i_0 (i = ordsucc m) (apply_fun e m) (apply_fun e i) Hnism) (from left to right).
An exact proof term for the current goal is (HeFun i HiDom).
We prove the intermediate claim swap_last_two_agree_lt: ∀e m i : set, nat_p mi mapply_fun (swap_last_two e m) i = apply_fun e i.
Let e, m and i be given.
Assume HmNat: nat_p m.
Assume HiIn: i m.
We prove the intermediate claim HiDom: i ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI1 (ordsucc m) i (ordsuccI1 m i HiIn)).
We prove the intermediate claim Hdef: swap_last_two e m = graph (ordsucc (ordsucc m)) (λj : setif j = m then apply_fun e (ordsucc m) else if j = ordsucc m then apply_fun e m else apply_fun e j).
Use reflexivity.
rewrite the current goal using Hdef (from left to right) at position 1.
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λj : setif j = m then apply_fun e (ordsucc m) else if j = ordsucc m then apply_fun e m else apply_fun e j) i HiDom) (from left to right).
We prove the intermediate claim Hneq1: ¬ (i = m).
Assume Heq: i = m.
We prove the intermediate claim HmIn: m m.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is HiIn.
An exact proof term for the current goal is ((In_irref m) HmIn).
rewrite the current goal using (If_i_0 (i = m) (apply_fun e (ordsucc m)) (if i = ordsucc m then apply_fun e m else apply_fun e i) Hneq1) (from left to right).
We prove the intermediate claim Hneq2: ¬ (i = ordsucc m).
Assume Heq: i = ordsucc m.
We prove the intermediate claim HsmIn: ordsucc m m.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is HiIn.
We prove the intermediate claim HmOrd: ordinal m.
An exact proof term for the current goal is (nat_p_ordinal m HmNat).
We prove the intermediate claim HmTS: TransSet m.
An exact proof term for the current goal is (ordinal_TransSet m HmOrd).
We prove the intermediate claim HsmSub: ordsucc m m.
An exact proof term for the current goal is (HmTS (ordsucc m) HsmIn).
We prove the intermediate claim HmIn: m m.
An exact proof term for the current goal is (HsmSub m (ordsuccI2 m)).
An exact proof term for the current goal is ((In_irref m) HmIn).
rewrite the current goal using (If_i_0 (i = ordsucc m) (apply_fun e m) (apply_fun e i) Hneq2) (from left to right).
Use reflexivity.
We prove the intermediate claim swap_last_two_at_m: ∀e m : set, nat_p mapply_fun (swap_last_two e m) m = apply_fun e (ordsucc m).
Let e and m be given.
Assume HmNat: nat_p m.
We prove the intermediate claim HmDom: m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI1 (ordsucc m) m (ordsuccI2 m)).
We prove the intermediate claim Hdef: swap_last_two e m = graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i).
Use reflexivity.
rewrite the current goal using Hdef (from left to right) at position 1.
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i) m HmDom) (from left to right).
We prove the intermediate claim Hmm: m = m.
Use reflexivity.
rewrite the current goal using (If_i_1 (m = m) (apply_fun e (ordsucc m)) (if m = ordsucc m then apply_fun e m else apply_fun e m) Hmm) (from left to right).
Use reflexivity.
We prove the intermediate claim swap_last_two_at_sm: ∀e m : set, nat_p mapply_fun (swap_last_two e m) (ordsucc m) = apply_fun e m.
Let e and m be given.
Assume HmNat: nat_p m.
We prove the intermediate claim HsmDom: ordsucc m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI2 (ordsucc m)).
We prove the intermediate claim Hdef: swap_last_two e m = graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i).
Use reflexivity.
rewrite the current goal using Hdef (from left to right) at position 1.
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i) (ordsucc m) HsmDom) (from left to right).
We prove the intermediate claim Hneq: ¬ (ordsucc m = m).
Assume Heq: ordsucc m = m.
We prove the intermediate claim HmIn: m m.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 m).
An exact proof term for the current goal is ((In_irref m) HmIn).
rewrite the current goal using (If_i_0 (ordsucc m = m) (apply_fun e (ordsucc m)) (if ordsucc m = ordsucc m then apply_fun e m else apply_fun e (ordsucc m)) Hneq) (from left to right).
We prove the intermediate claim Hss: ordsucc m = ordsucc m.
Use reflexivity.
rewrite the current goal using (If_i_1 (ordsucc m = ordsucc m) (apply_fun e m) (apply_fun e (ordsucc m)) Hss) (from left to right).
Use reflexivity.
We prove the intermediate claim bijection_swap_last_two: ∀F e m : set, nat_p mbijection (ordsucc (ordsucc m)) F ebijection (ordsucc (ordsucc m)) F (swap_last_two e m).
Let F, e and m be given.
Assume HmNat: nat_p m.
Assume Hbij: bijection (ordsucc (ordsucc m)) F e.
We prove the intermediate claim HeFun: function_on e (ordsucc (ordsucc m)) F.
An exact proof term for the current goal is (andEL (function_on e (ordsucc (ordsucc m)) F) (∀y : set, y F∃x0 : set, x0 ordsucc (ordsucc m) apply_fun e x0 = y (∀x' : set, x' ordsucc (ordsucc m)apply_fun e x' = yx' = x0)) Hbij).
We prove the intermediate claim Huniq: ∀y : set, y F∃x0 : set, x0 ordsucc (ordsucc m) apply_fun e x0 = y (∀x' : set, x' ordsucc (ordsucc m)apply_fun e x' = yx' = x0).
An exact proof term for the current goal is (andER (function_on e (ordsucc (ordsucc m)) F) (∀y : set, y F∃x0 : set, x0 ordsucc (ordsucc m) apply_fun e x0 = y (∀x' : set, x' ordsucc (ordsucc m)apply_fun e x' = yx' = x0)) Hbij).
We will prove function_on (swap_last_two e m) (ordsucc (ordsucc m)) F (∀y : set, y F∃x0 : set, x0 ordsucc (ordsucc m) apply_fun (swap_last_two e m) x0 = y (∀x' : set, x' ordsucc (ordsucc m)apply_fun (swap_last_two e m) x' = yx' = x0)).
Apply andI to the current goal.
An exact proof term for the current goal is (function_on_swap_last_two F e m HmNat HeFun).
Let y be given.
Assume HyF: y F.
Apply (Huniq y HyF) to the current goal.
Let x0 be given.
Assume Hx0pack.
We prove the intermediate claim Hx0AB: x0 ordsucc (ordsucc m) apply_fun e x0 = y.
An exact proof term for the current goal is (andEL (x0 ordsucc (ordsucc m) apply_fun e x0 = y) (∀x' : set, x' ordsucc (ordsucc m)apply_fun e x' = yx' = x0) Hx0pack).
We prove the intermediate claim Hx0Dom: x0 ordsucc (ordsucc m).
An exact proof term for the current goal is (andEL (x0 ordsucc (ordsucc m)) (apply_fun e x0 = y) Hx0AB).
We prove the intermediate claim Hex0: apply_fun e x0 = y.
An exact proof term for the current goal is (andER (x0 ordsucc (ordsucc m)) (apply_fun e x0 = y) Hx0AB).
We prove the intermediate claim Huniq0: ∀x' : set, x' ordsucc (ordsucc m)apply_fun e x' = yx' = x0.
An exact proof term for the current goal is (andER (x0 ordsucc (ordsucc m) apply_fun e x0 = y) (∀x' : set, x' ordsucc (ordsucc m)apply_fun e x' = yx' = x0) Hx0pack).
Set x1 to be the term If_i (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0).
We prove the intermediate claim Hx1Def: x1 = If_i (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0).
Use reflexivity.
We prove the intermediate claim Hx1Dom: x1 ordsucc (ordsucc m).
rewrite the current goal using Hx1Def (from left to right) at position 1.
Apply (xm (x0 = m)) to the current goal.
Assume Hx0m: x0 = m.
rewrite the current goal using (If_i_1 (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0) Hx0m) (from left to right).
An exact proof term for the current goal is (ordsuccI2 (ordsucc m)).
Assume Hx0nm: ¬ (x0 = m).
rewrite the current goal using (If_i_0 (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0) Hx0nm) (from left to right).
Apply (xm (x0 = ordsucc m)) to the current goal.
Assume Hx0sm: x0 = ordsucc m.
rewrite the current goal using (If_i_1 (x0 = ordsucc m) m x0 Hx0sm) (from left to right).
An exact proof term for the current goal is (ordsuccI1 (ordsucc m) m (ordsuccI2 m)).
Assume Hx0nsm: ¬ (x0 = ordsucc m).
rewrite the current goal using (If_i_0 (x0 = ordsucc m) m x0 Hx0nsm) (from left to right).
An exact proof term for the current goal is Hx0Dom.
We prove the intermediate claim Hx1Eq: apply_fun (swap_last_two e m) x1 = y.
rewrite the current goal using Hx1Def (from left to right) at position 1.
Apply (xm (x0 = m)) to the current goal.
Assume Hx0m: x0 = m.
rewrite the current goal using (If_i_1 (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0) Hx0m) (from left to right).
We prove the intermediate claim HsmDom2: ordsucc m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI2 (ordsucc m)).
We prove the intermediate claim Hdef2: swap_last_two e m = graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i).
Use reflexivity.
rewrite the current goal using Hdef2 (from left to right) at position 1.
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i) (ordsucc m) HsmDom2) (from left to right) at position 1.
We prove the intermediate claim Hneq: ¬ (ordsucc m = m).
Assume Heq: ordsucc m = m.
We prove the intermediate claim HmIn: m m.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 m).
An exact proof term for the current goal is ((In_irref m) HmIn).
rewrite the current goal using (If_i_0 (ordsucc m = m) (apply_fun e (ordsucc m)) (if ordsucc m = ordsucc m then apply_fun e m else apply_fun e (ordsucc m)) Hneq) (from left to right).
We prove the intermediate claim Hss: ordsucc m = ordsucc m.
Use reflexivity.
rewrite the current goal using (If_i_1 (ordsucc m = ordsucc m) (apply_fun e m) (apply_fun e (ordsucc m)) Hss) (from left to right).
rewrite the current goal using Hx0m (from right to left) at position 1.
An exact proof term for the current goal is Hex0.
Assume Hx0nm: ¬ (x0 = m).
rewrite the current goal using (If_i_0 (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0) Hx0nm) (from left to right).
Apply (xm (x0 = ordsucc m)) to the current goal.
Assume Hx0sm: x0 = ordsucc m.
rewrite the current goal using (If_i_1 (x0 = ordsucc m) m x0 Hx0sm) (from left to right).
We prove the intermediate claim HmDom2: m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI1 (ordsucc m) m (ordsuccI2 m)).
We prove the intermediate claim Hdef2: swap_last_two e m = graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i).
Use reflexivity.
rewrite the current goal using Hdef2 (from left to right) at position 1.
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i) m HmDom2) (from left to right) at position 1.
We prove the intermediate claim Hmm: m = m.
Use reflexivity.
rewrite the current goal using (If_i_1 (m = m) (apply_fun e (ordsucc m)) (if m = ordsucc m then apply_fun e m else apply_fun e m) Hmm) (from left to right).
rewrite the current goal using Hx0sm (from right to left) at position 1.
An exact proof term for the current goal is Hex0.
Assume Hx0nsm: ¬ (x0 = ordsucc m).
rewrite the current goal using (If_i_0 (x0 = ordsucc m) m x0 Hx0nsm) (from left to right).
We prove the intermediate claim Hx0InSm: x0 ordsucc m.
We prove the intermediate claim Hcase: x0 ordsucc m x0 = ordsucc m.
An exact proof term for the current goal is (ordsuccE (ordsucc m) x0 Hx0Dom).
Apply (Hcase (x0 ordsucc m)) to the current goal.
Assume Hx0In: x0 ordsucc m.
An exact proof term for the current goal is Hx0In.
Assume Hx0Eq: x0 = ordsucc m.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hx0nsm Hx0Eq).
We prove the intermediate claim Hx0InM: x0 m.
We prove the intermediate claim Hcase: x0 m x0 = m.
An exact proof term for the current goal is (ordsuccE m x0 Hx0InSm).
Apply (Hcase (x0 m)) to the current goal.
Assume Hx0In: x0 m.
An exact proof term for the current goal is Hx0In.
Assume Hx0Eq: x0 = m.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hx0nm Hx0Eq).
We prove the intermediate claim Hdef3: swap_last_two e m = graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i).
Use reflexivity.
rewrite the current goal using Hdef3 (from left to right) at position 1.
rewrite the current goal using (apply_fun_graph (ordsucc (ordsucc m)) (λi : setif i = m then apply_fun e (ordsucc m) else if i = ordsucc m then apply_fun e m else apply_fun e i) x0 Hx0Dom) (from left to right) at position 1.
rewrite the current goal using (If_i_0 (x0 = m) (apply_fun e (ordsucc m)) (if x0 = ordsucc m then apply_fun e m else apply_fun e x0) Hx0nm) (from left to right).
rewrite the current goal using (If_i_0 (x0 = ordsucc m) (apply_fun e m) (apply_fun e x0) Hx0nsm) (from left to right).
An exact proof term for the current goal is Hex0.
We use x1 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 Hx1Dom.
An exact proof term for the current goal is Hx1Eq.
Let x' be given.
Assume Hx'Dom: x' ordsucc (ordsucc m).
Assume Hx'Eq: apply_fun (swap_last_two e m) x' = y.
We will prove x' = x1.
We prove the intermediate claim Hx'case: x' ordsucc m x' = ordsucc m.
An exact proof term for the current goal is (ordsuccE (ordsucc m) x' Hx'Dom).
Apply (Hx'case (x' = x1)) to the current goal.
Assume Hx'InSm: x' ordsucc m.
We prove the intermediate claim Hx'case2: x' m x' = m.
An exact proof term for the current goal is (ordsuccE m x' Hx'InSm).
Apply (Hx'case2 (x' = x1)) to the current goal.
Assume Hx'InM: x' m.
We prove the intermediate claim HyEqE: apply_fun e x' = y.
rewrite the current goal using (swap_last_two_agree_lt e m x' HmNat Hx'InM) (from right to left) at position 1.
An exact proof term for the current goal is Hx'Eq.
We prove the intermediate claim Hx'x0: x' = x0.
An exact proof term for the current goal is (Huniq0 x' Hx'Dom HyEqE).
Apply (xm (x0 = m)) to the current goal.
Assume Hx0m: x0 = m.
Apply FalseE to the current goal.
We prove the intermediate claim Hx'm: x' = m.
rewrite the current goal using Hx'x0 (from left to right) at position 1.
An exact proof term for the current goal is Hx0m.
We prove the intermediate claim HmIn: m m.
rewrite the current goal using Hx'm (from right to left) at position 1.
An exact proof term for the current goal is Hx'InM.
An exact proof term for the current goal is ((In_irref m) HmIn).
Assume Hx0nm: ¬ (x0 = m).
rewrite the current goal using (If_i_0 (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0) Hx0nm) (from left to right).
Apply (xm (x0 = ordsucc m)) to the current goal.
Assume Hx0sm: x0 = ordsucc m.
Apply FalseE to the current goal.
We prove the intermediate claim Hx'sm: x' = ordsucc m.
rewrite the current goal using Hx'x0 (from left to right) at position 1.
An exact proof term for the current goal is Hx0sm.
We prove the intermediate claim HsmIn: ordsucc m m.
rewrite the current goal using Hx'sm (from right to left) at position 1.
An exact proof term for the current goal is Hx'InM.
We prove the intermediate claim HmOrd: ordinal m.
An exact proof term for the current goal is (nat_p_ordinal m HmNat).
We prove the intermediate claim HmTS: TransSet m.
An exact proof term for the current goal is (ordinal_TransSet m HmOrd).
We prove the intermediate claim HsmSub: ordsucc m m.
An exact proof term for the current goal is (HmTS (ordsucc m) HsmIn).
We prove the intermediate claim HmIn: m m.
An exact proof term for the current goal is (HsmSub m (ordsuccI2 m)).
An exact proof term for the current goal is ((In_irref m) HmIn).
Assume Hx0nsm: ¬ (x0 = ordsucc m).
rewrite the current goal using (If_i_0 (x0 = ordsucc m) m x0 Hx0nsm) (from left to right).
rewrite the current goal using Hx'x0 (from right to left) at position 1.
Use reflexivity.
Assume Hx'm: x' = m.
We prove the intermediate claim HyEqE: apply_fun e (ordsucc m) = y.
We prove the intermediate claim Htmp: apply_fun (swap_last_two e m) m = y.
rewrite the current goal using Hx'm (from right to left) at position 2.
An exact proof term for the current goal is Hx'Eq.
rewrite the current goal using (swap_last_two_at_m e m HmNat) (from right to left) at position 1.
An exact proof term for the current goal is Htmp.
We prove the intermediate claim Hx0sm0: ordsucc m = x0.
An exact proof term for the current goal is (Huniq0 (ordsucc m) (ordsuccI2 (ordsucc m)) HyEqE).
We prove the intermediate claim Hx0sm: x0 = ordsucc m.
Use symmetry.
An exact proof term for the current goal is Hx0sm0.
Apply (xm (x0 = m)) to the current goal.
Assume Hx0m: x0 = m.
Apply FalseE to the current goal.
We prove the intermediate claim Heq: m = ordsucc m.
rewrite the current goal using Hx0m (from right to left) at position 1.
An exact proof term for the current goal is Hx0sm.
We prove the intermediate claim HmIn: m m.
rewrite the current goal using Heq (from left to right) at position 2.
An exact proof term for the current goal is (ordsuccI2 m).
An exact proof term for the current goal is ((In_irref m) HmIn).
Assume Hx0nm: ¬ (x0 = m).
rewrite the current goal using (If_i_0 (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0) Hx0nm) (from left to right).
rewrite the current goal using (If_i_1 (x0 = ordsucc m) m x0 Hx0sm) (from left to right).
rewrite the current goal using Hx'm (from right to left) at position 1.
Use reflexivity.
Assume Hx'sm: x' = ordsucc m.
We prove the intermediate claim HyEqE: apply_fun e m = y.
We prove the intermediate claim Htmp: apply_fun (swap_last_two e m) (ordsucc m) = y.
rewrite the current goal using Hx'sm (from right to left) at position 1.
An exact proof term for the current goal is Hx'Eq.
rewrite the current goal using (swap_last_two_at_sm e m HmNat) (from right to left) at position 1.
An exact proof term for the current goal is Htmp.
We prove the intermediate claim Hx0m0: m = x0.
An exact proof term for the current goal is (Huniq0 m (ordsuccI1 (ordsucc m) m (ordsuccI2 m)) HyEqE).
We prove the intermediate claim Hx0m: x0 = m.
Use symmetry.
An exact proof term for the current goal is Hx0m0.
rewrite the current goal using (If_i_1 (x0 = m) (ordsucc m) (If_i (x0 = ordsucc m) m x0) Hx0m) (from left to right).
rewrite the current goal using Hx'sm (from right to left) at position 1.
Use reflexivity.
We prove the intermediate claim weighted_sum_congr: ∀x n e1 e2 : set, nat_p n(∀k : set, k napply_fun e1 k = apply_fun e2 k)weighted_sum x n e1 = weighted_sum x n e2.
Let x, n, e1 and e2 be given.
Assume HnNat: nat_p n.
Assume Heq: ∀k : set, k napply_fun e1 k = apply_fun e2 k.
We prove the intermediate claim Hdef1: weighted_sum x n e1 = nat_primrec 0 (weighted_step x e1) n.
Use reflexivity.
We prove the intermediate claim Hdef2: weighted_sum x n e2 = nat_primrec 0 (weighted_step x e2) n.
Use reflexivity.
rewrite the current goal using Hdef1 (from left to right).
rewrite the current goal using Hdef2 (from left to right).
Set Pws to be the term λm : set∀eA eB : set, (∀k : set, k mapply_fun eA k = apply_fun eB k)nat_primrec 0 (weighted_step x eA) m = nat_primrec 0 (weighted_step x eB) m.
We prove the intermediate claim HP0: Pws 0.
Let eA and eB be given.
Assume Heq0: ∀k : set, k 0apply_fun eA k = apply_fun eB k.
rewrite the current goal using (nat_primrec_0 0 (weighted_step x eA)) (from left to right).
rewrite the current goal using (nat_primrec_0 0 (weighted_step x eB)) (from left to right).
Use reflexivity.
We prove the intermediate claim HPS: ∀m : set, nat_p mPws mPws (ordsucc m).
Let m be given.
Assume HmNat: nat_p m.
Assume IHm: Pws m.
We will prove Pws (ordsucc m).
Let eA and eB be given.
Assume HeqS: ∀k : set, k ordsucc mapply_fun eA k = apply_fun eB k.
rewrite the current goal using (nat_primrec_S 0 (weighted_step x eA) m HmNat) (from left to right).
rewrite the current goal using (nat_primrec_S 0 (weighted_step x eB) m HmNat) (from left to right).
We prove the intermediate claim Heqm: ∀k : set, k mapply_fun eA k = apply_fun eB k.
Let k be given.
Assume Hk: k m.
An exact proof term for the current goal is (HeqS k (ordsuccI1 m k Hk)).
We prove the intermediate claim Hacc: nat_primrec 0 (weighted_step x eA) m = nat_primrec 0 (weighted_step x eB) m.
An exact proof term for the current goal is (IHm eA eB Heqm).
We prove the intermediate claim Hem: apply_fun eA m = apply_fun eB m.
An exact proof term for the current goal is (HeqS m (ordsuccI2 m)).
rewrite the current goal using Hacc (from left to right).
rewrite the current goal using Hem (from left to right).
Use reflexivity.
We prove the intermediate claim HnP: Pws n.
An exact proof term for the current goal is (nat_ind Pws HP0 HPS n HnNat).
An exact proof term for the current goal is (HnP e1 e2 Heq).
We prove the intermediate claim weighted_sum_swap_last_two: ∀x e m : set, nat_p mSNo (weighted_sum x m e)SNo (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x))SNo (mul_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) (apply_fun (apply_fun e (ordsucc m)) x))weighted_sum x (ordsucc (ordsucc m)) (swap_last_two e m) = weighted_sum x (ordsucc (ordsucc m)) e.
Let x, e and m be given.
Assume HmNat: nat_p m.
Assume HaccS: SNo (weighted_sum x m e).
Assume Hterm_mS: SNo (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
Assume Hterm_smS: SNo (mul_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) (apply_fun (apply_fun e (ordsucc m)) x)).
We prove the intermediate claim HsmNat: nat_p (ordsucc m).
An exact proof term for the current goal is (nat_ordsucc m HmNat).
We prove the intermediate claim HssmNat: nat_p (ordsucc (ordsucc m)).
An exact proof term for the current goal is (nat_ordsucc (ordsucc m) HsmNat).
We prove the intermediate claim Hm_congr: weighted_sum x m (swap_last_two e m) = weighted_sum x m e.
Apply (weighted_sum_congr x m (swap_last_two e m) e HmNat) to the current goal.
Let k be given.
Assume HkIn: k m.
An exact proof term for the current goal is (swap_last_two_agree_lt e m k HmNat HkIn).
Set tm to be the term mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x).
Set tsm to be the term mul_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) (apply_fun (apply_fun e (ordsucc m)) x).
We prove the intermediate claim HtmDef0: tm = mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x).
Use reflexivity.
We prove the intermediate claim HtsmDef0: tsm = mul_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) (apply_fun (apply_fun e (ordsucc m)) x).
Use reflexivity.
We prove the intermediate claim HtmS: SNo tm.
rewrite the current goal using HtmDef0 (from left to right).
An exact proof term for the current goal is Hterm_mS.
We prove the intermediate claim HtsmS: SNo tsm.
rewrite the current goal using HtsmDef0 (from left to right).
An exact proof term for the current goal is Hterm_smS.
We prove the intermediate claim Hws_sm_swap: weighted_sum x (ordsucc m) (swap_last_two e m) = add_SNo (weighted_sum x m e) tsm.
We prove the intermediate claim HwsS: weighted_sum x (ordsucc m) (swap_last_two e m) = weighted_step x (swap_last_two e m) m (weighted_sum x m (swap_last_two e m)).
An exact proof term for the current goal is (weighted_sum_S x (swap_last_two e m) m HmNat).
rewrite the current goal using HwsS (from left to right).
rewrite the current goal using Hm_congr (from left to right).
We prove the intermediate claim HstepDef: weighted_step x (swap_last_two e m) m (weighted_sum x m e) = add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun (swap_last_two e m) m)) (apply_fun (apply_fun (swap_last_two e m) m) x)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
Set y to be the term apply_fun (swap_last_two e m) m.
We prove the intermediate claim HyDef: y = apply_fun (swap_last_two e m) m.
Use reflexivity.
rewrite the current goal using HyDef (from right to left) at position 1.
rewrite the current goal using HyDef (from right to left) at position 1.
We prove the intermediate claim Hy: y = apply_fun e (ordsucc m).
rewrite the current goal using HyDef (from left to right).
An exact proof term for the current goal is (swap_last_two_at_m e m HmNat).
rewrite the current goal using Hy (from left to right) at position 1.
rewrite the current goal using Hy (from left to right) at position 1.
We prove the intermediate claim HtsmDef: tsm = mul_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) (apply_fun (apply_fun e (ordsucc m)) x).
Use reflexivity.
rewrite the current goal using HtsmDef (from left to right) at position 1.
Use reflexivity.
We prove the intermediate claim Hws_sm: weighted_sum x (ordsucc m) e = add_SNo (weighted_sum x m e) tm.
We prove the intermediate claim HwsS: weighted_sum x (ordsucc m) e = weighted_step x e m (weighted_sum x m e).
An exact proof term for the current goal is (weighted_sum_S x e m HmNat).
rewrite the current goal using HwsS (from left to right).
Use reflexivity.
We prove the intermediate claim Hws_ssm_swap: weighted_sum x (ordsucc (ordsucc m)) (swap_last_two e m) = add_SNo (add_SNo (weighted_sum x m e) tsm) tm.
We prove the intermediate claim HwsS: weighted_sum x (ordsucc (ordsucc m)) (swap_last_two e m) = weighted_step x (swap_last_two e m) (ordsucc m) (weighted_sum x (ordsucc m) (swap_last_two e m)).
An exact proof term for the current goal is (weighted_sum_S x (swap_last_two e m) (ordsucc m) HsmNat).
rewrite the current goal using HwsS (from left to right).
rewrite the current goal using Hws_sm_swap (from left to right).
We prove the intermediate claim HstepDef: weighted_step x (swap_last_two e m) (ordsucc m) (add_SNo (weighted_sum x m e) tsm) = add_SNo (add_SNo (weighted_sum x m e) tsm) (mul_SNo (apply_fun coef_of (apply_fun (swap_last_two e m) (ordsucc m))) (apply_fun (apply_fun (swap_last_two e m) (ordsucc m)) x)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
Set y to be the term apply_fun (swap_last_two e m) (ordsucc m).
We prove the intermediate claim HyDef: y = apply_fun (swap_last_two e m) (ordsucc m).
Use reflexivity.
rewrite the current goal using HyDef (from right to left) at position 1.
rewrite the current goal using HyDef (from right to left) at position 1.
We prove the intermediate claim Hy: y = apply_fun e m.
rewrite the current goal using HyDef (from left to right).
An exact proof term for the current goal is (swap_last_two_at_sm e m HmNat).
rewrite the current goal using Hy (from left to right) at position 1.
rewrite the current goal using Hy (from left to right) at position 1.
We prove the intermediate claim HtmDef: tm = mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x).
Use reflexivity.
rewrite the current goal using HtmDef (from left to right) at position 1.
Use reflexivity.
We prove the intermediate claim Hws_ssm: weighted_sum x (ordsucc (ordsucc m)) e = add_SNo (add_SNo (weighted_sum x m e) tm) tsm.
We prove the intermediate claim HwsS: weighted_sum x (ordsucc (ordsucc m)) e = weighted_step x e (ordsucc m) (weighted_sum x (ordsucc m) e).
An exact proof term for the current goal is (weighted_sum_S x e (ordsucc m) HsmNat).
rewrite the current goal using HwsS (from left to right).
rewrite the current goal using Hws_sm (from left to right).
Use reflexivity.
rewrite the current goal using Hws_ssm_swap (from left to right).
rewrite the current goal using Hws_ssm (from left to right).
We prove the intermediate claim Hs_tmS: SNo (add_SNo (weighted_sum x m e) tm).
An exact proof term for the current goal is (SNo_add_SNo (weighted_sum x m e) tm HaccS HtmS).
We prove the intermediate claim Hs_tsmS: SNo (add_SNo (weighted_sum x m e) tsm).
An exact proof term for the current goal is (SNo_add_SNo (weighted_sum x m e) tsm HaccS HtsmS).
An exact proof term for the current goal is (add_SNo_com_3b_1_2 (weighted_sum x m e) tsm tm HaccS HtsmS HtmS).
We prove the intermediate claim weighted_sum_swap_last_two_real: ∀x e m : set, nat_p mweighted_sum x m e Rapply_fun coef_of (apply_fun e m) Rapply_fun (apply_fun e m) x Rapply_fun coef_of (apply_fun e (ordsucc m)) Rapply_fun (apply_fun e (ordsucc m)) x Rweighted_sum x (ordsucc (ordsucc m)) (swap_last_two e m) = weighted_sum x (ordsucc (ordsucc m)) e.
Let x, e and m be given.
Assume HmNat: nat_p m.
Assume HwsR: weighted_sum x m e R.
Assume Hcoef_mR: apply_fun coef_of (apply_fun e m) R.
Assume Hval_mR: apply_fun (apply_fun e m) x R.
Assume Hcoef_smR: apply_fun coef_of (apply_fun e (ordsucc m)) R.
Assume Hval_smR: apply_fun (apply_fun e (ordsucc m)) x R.
We prove the intermediate claim HwsS: SNo (weighted_sum x m e).
An exact proof term for the current goal is (real_SNo (weighted_sum x m e) HwsR).
We prove the intermediate claim Hcoef_mS: SNo (apply_fun coef_of (apply_fun e m)).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of (apply_fun e m)) Hcoef_mR).
We prove the intermediate claim Hval_mS: SNo (apply_fun (apply_fun e m) x).
An exact proof term for the current goal is (real_SNo (apply_fun (apply_fun e m) x) Hval_mR).
We prove the intermediate claim Hcoef_smS: SNo (apply_fun coef_of (apply_fun e (ordsucc m))).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) Hcoef_smR).
We prove the intermediate claim Hval_smS: SNo (apply_fun (apply_fun e (ordsucc m)) x).
An exact proof term for the current goal is (real_SNo (apply_fun (apply_fun e (ordsucc m)) x) Hval_smR).
We prove the intermediate claim Hterm_mS: SNo (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
An exact proof term for the current goal is (SNo_mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x) Hcoef_mS Hval_mS).
We prove the intermediate claim Hterm_smS: SNo (mul_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) (apply_fun (apply_fun e (ordsucc m)) x)).
An exact proof term for the current goal is (SNo_mul_SNo (apply_fun coef_of (apply_fun e (ordsucc m))) (apply_fun (apply_fun e (ordsucc m)) x) Hcoef_smS Hval_smS).
An exact proof term for the current goal is (weighted_sum_swap_last_two x e m HmNat HwsS Hterm_mS Hterm_smS).
We prove the intermediate claim weighted_sum_swap_adjacent_last_real: ∀x e m : set, nat_p mweighted_sum x m e Rapply_fun coef_of (apply_fun e m) Rapply_fun (apply_fun e m) x Rapply_fun coef_of (apply_fun e (ordsucc m)) Rapply_fun (apply_fun e (ordsucc m)) x Rweighted_sum x (ordsucc (ordsucc m)) (swap_adjacent e m (ordsucc (ordsucc m))) = weighted_sum x (ordsucc (ordsucc m)) e.
Let x, e and m be given.
Assume HmNat: nat_p m.
Assume HwsR: weighted_sum x m e R.
Assume Hcoef_mR: apply_fun coef_of (apply_fun e m) R.
Assume Hval_mR: apply_fun (apply_fun e m) x R.
Assume Hcoef_smR: apply_fun coef_of (apply_fun e (ordsucc m)) R.
Assume Hval_smR: apply_fun (apply_fun e (ordsucc m)) x R.
We prove the intermediate claim HsmNat: nat_p (ordsucc m).
An exact proof term for the current goal is (nat_ordsucc m HmNat).
We prove the intermediate claim HssmNat: nat_p (ordsucc (ordsucc m)).
An exact proof term for the current goal is (nat_ordsucc (ordsucc m) HsmNat).
We prove the intermediate claim Heq: ∀k : set, k ordsucc (ordsucc m)apply_fun (swap_adjacent e m (ordsucc (ordsucc m))) k = apply_fun (swap_last_two e m) k.
Let k be given.
Assume HkDom: k ordsucc (ordsucc m).
We prove the intermediate claim Hsa: apply_fun (swap_adjacent e m (ordsucc (ordsucc m))) k = if k = m then apply_fun e (ordsucc m) else if k = ordsucc m then apply_fun e m else apply_fun e k.
An exact proof term for the current goal is (swap_adjacent_apply e m (ordsucc (ordsucc m)) k HkDom).
We prove the intermediate claim Hsl: apply_fun (swap_last_two e m) k = if k = m then apply_fun e (ordsucc m) else if k = ordsucc m then apply_fun e m else apply_fun e k.
An exact proof term for the current goal is (swap_last_two_apply e m k HkDom).
rewrite the current goal using Hsa (from left to right).
rewrite the current goal using Hsl (from left to right).
Use reflexivity.
We prove the intermediate claim Hcongr: weighted_sum x (ordsucc (ordsucc m)) (swap_adjacent e m (ordsucc (ordsucc m))) = weighted_sum x (ordsucc (ordsucc m)) (swap_last_two e m).
An exact proof term for the current goal is (weighted_sum_congr x (ordsucc (ordsucc m)) (swap_adjacent e m (ordsucc (ordsucc m))) (swap_last_two e m) HssmNat Heq).
rewrite the current goal using Hcongr (from left to right).
An exact proof term for the current goal is (weighted_sum_swap_last_two_real x e m HmNat HwsR Hcoef_mR Hval_mR Hcoef_smR Hval_smR).
We prove the intermediate claim add_SNo_com_3b_1_2_real: ∀x y z : set, x Ry Rz Radd_SNo (add_SNo x y) z = add_SNo (add_SNo x z) y.
Let x, y and z be given.
Assume HxR: x R.
Assume HyR: y R.
Assume HzR: z R.
We prove the intermediate claim HxS: SNo x.
An exact proof term for the current goal is (real_SNo x HxR).
We prove the intermediate claim HyS: SNo y.
An exact proof term for the current goal is (real_SNo y HyR).
We prove the intermediate claim HzS: SNo z.
An exact proof term for the current goal is (real_SNo z HzR).
An exact proof term for the current goal is (add_SNo_com_3b_1_2 x y z HxS HyS HzS).
We prove the intermediate claim weighted_sum_S_drop_zero: ∀x e n : set, nat_p nweighted_sum x n e Rapply_fun (apply_fun e n) x = 0apply_fun coef_of (apply_fun e n) Rweighted_sum x (ordsucc n) e = weighted_sum x n e.
Let x, e and n be given.
Assume HnNat: nat_p n.
Assume HwsR: weighted_sum x n e R.
Assume Hval0: apply_fun (apply_fun e n) x = 0.
Assume HcoefR: apply_fun coef_of (apply_fun e n) R.
We prove the intermediate claim HL: weighted_sum x (ordsucc n) e = nat_primrec 0 (weighted_step x e) (ordsucc n).
Use reflexivity.
We prove the intermediate claim HR: weighted_sum x n e = nat_primrec 0 (weighted_step x e) n.
Use reflexivity.
rewrite the current goal using HL (from left to right).
rewrite the current goal using HR (from left to right).
rewrite the current goal using (nat_primrec_S 0 (weighted_step x e) n HnNat) (from left to right).
Set acc to be the term nat_primrec 0 (weighted_step x e) n.
We prove the intermediate claim HaccR: acc R.
rewrite the current goal using HR (from right to left).
An exact proof term for the current goal is HwsR.
We prove the intermediate claim HaccS: SNo acc.
An exact proof term for the current goal is (real_SNo acc HaccR).
rewrite the current goal using Hval0 (from left to right).
We prove the intermediate claim HcoefS: SNo (apply_fun coef_of (apply_fun e n)).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of (apply_fun e n)) HcoefR).
We prove the intermediate claim Hterm0: mul_SNo (apply_fun coef_of (apply_fun e n)) 0 = 0.
An exact proof term for the current goal is (mul_SNo_zeroR (apply_fun coef_of (apply_fun e n)) HcoefS).
rewrite the current goal using Hterm0 (from left to right).
An exact proof term for the current goal is (add_SNo_0R acc HaccS).
We prove the intermediate claim weighted_step_drop_zero_value: ∀x e k acc : set, acc Rapply_fun coef_of (apply_fun e k) Rapply_fun (apply_fun e k) x = 0weighted_step x e k acc = acc.
Let x, e, k and acc be given.
Assume HaccR: acc R.
Assume HcoefR: apply_fun coef_of (apply_fun e k) R.
Assume Hval0: apply_fun (apply_fun e k) x = 0.
We prove the intermediate claim HaccS: SNo acc.
An exact proof term for the current goal is (real_SNo acc HaccR).
We prove the intermediate claim HcoefS: SNo (apply_fun coef_of (apply_fun e k)).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of (apply_fun e k)) HcoefR).
We prove the intermediate claim Hdef: weighted_step x e k acc = add_SNo acc (mul_SNo (apply_fun coef_of (apply_fun e k)) (apply_fun (apply_fun e k) x)).
Use reflexivity.
rewrite the current goal using Hdef (from left to right).
rewrite the current goal using Hval0 (from left to right).
We prove the intermediate claim Hterm0: mul_SNo (apply_fun coef_of (apply_fun e k)) 0 = 0.
An exact proof term for the current goal is (mul_SNo_zeroR (apply_fun coef_of (apply_fun e k)) HcoefS).
rewrite the current goal using Hterm0 (from left to right).
An exact proof term for the current goal is (add_SNo_0R acc HaccS).
We prove the intermediate claim weighted_sum_prefix_in_R: ∀x n e : set, x Xn ω(∀k : set, k napply_fun e k P)(∀k : set, k napply_fun (apply_fun e k) x R)(∀k : set, k napply_fun coef_of (apply_fun e k) R)∀m : set, m ordsucc nweighted_sum x m e R.
Let x, n and e be given.
Assume HxX: x X.
Assume HnO: n ω.
Assume HekP: ∀k : set, k napply_fun e k P.
Assume HvalR: ∀k : set, k napply_fun (apply_fun e k) x R.
Assume HcoefR: ∀k : set, k napply_fun coef_of (apply_fun e k) R.
Let m be given.
Assume HmIn: m ordsucc n.
We prove the intermediate claim HnNat: nat_p n.
An exact proof term for the current goal is (omega_nat_p n HnO).
Set Pws to be the term λt : sett ordsucc nweighted_sum x t e R.
We prove the intermediate claim Hind: ∀t : set, nat_p tPws t.
Apply nat_ind to the current goal.
We will prove Pws 0.
Assume H0In: 0 ordsucc n.
rewrite the current goal using (weighted_sum_0 x e) (from left to right).
An exact proof term for the current goal is real_0.
Let t be given.
Assume HtNat: nat_p t.
Assume IHt: Pws t.
We will prove Pws (ordsucc t).
Assume HStIn: ordsucc t ordsucc n.
We prove the intermediate claim HnOrd: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd).
We prove the intermediate claim HtInN: t n.
We prove the intermediate claim Hcase: ordsucc t n ordsucc t = n.
An exact proof term for the current goal is (ordsuccE n (ordsucc t) HStIn).
Apply (Hcase (t n)) to the current goal.
Assume HStInN: ordsucc t n.
We prove the intermediate claim Hsub: ordsucc t n.
An exact proof term for the current goal is (HnTS (ordsucc t) HStInN).
An exact proof term for the current goal is (Hsub t (ordsuccI2 t)).
Assume Heq: ordsucc t = n.
rewrite the current goal using Heq (from right to left).
An exact proof term for the current goal is (ordsuccI2 t).
We prove the intermediate claim HtInSuccN: t ordsucc n.
An exact proof term for the current goal is ((ordsuccI1 n) t HtInN).
We prove the intermediate claim HaccR: weighted_sum x t e R.
An exact proof term for the current goal is (IHt HtInSuccN).
We prove the intermediate claim HvalRt: apply_fun (apply_fun e t) x R.
An exact proof term for the current goal is (HvalR t HtInN).
We prove the intermediate claim HcoefRt: apply_fun coef_of (apply_fun e t) R.
An exact proof term for the current goal is (HcoefR t HtInN).
We prove the intermediate claim HtermR: mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x) R.
An exact proof term for the current goal is (real_mul_SNo (apply_fun coef_of (apply_fun e t)) HcoefRt (apply_fun (apply_fun e t) x) HvalRt).
We prove the intermediate claim HwsS: weighted_sum x (ordsucc t) e = weighted_step x e t (weighted_sum x t e).
An exact proof term for the current goal is (weighted_sum_S x e t HtNat).
We prove the intermediate claim HstepR: weighted_step x e t (weighted_sum x t e) R.
We prove the intermediate claim Hdef: weighted_step x e t (weighted_sum x t e) = add_SNo (weighted_sum x t e) (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)).
Use reflexivity.
rewrite the current goal using Hdef (from left to right).
An exact proof term for the current goal is (real_add_SNo (weighted_sum x t e) HaccR (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)) HtermR).
We prove the intermediate claim Hsubst: ∀S T : set, S = TT RS R.
Let S and T be given.
Assume Heq: S = T.
Assume HT: T R.
rewrite the current goal using Heq (from left to right).
An exact proof term for the current goal is HT.
An exact proof term for the current goal is (Hsubst (weighted_sum x (ordsucc t) e) (weighted_step x e t (weighted_sum x t e)) HwsS HstepR).
We prove the intermediate claim HsuccNO: ordsucc n ω.
An exact proof term for the current goal is (omega_ordsucc n HnO).
We prove the intermediate claim HsuccNsubO: ordsucc n ω.
An exact proof term for the current goal is (omega_TransSet (ordsucc n) HsuccNO).
We prove the intermediate claim HmO: m ω.
An exact proof term for the current goal is (HsuccNsubO m HmIn).
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (omega_nat_p m HmO).
An exact proof term for the current goal is (Hind m HmNat HmIn).
We prove the intermediate claim weighted_sum_drop_last_of_bijection_zero_real: ∀x m F e : set, x Xm ωF P(∀f : set, f Fapply_fun f x R)(∀f : set, f Fapply_fun coef_of f R)bijection (ordsucc m) F eapply_fun (apply_fun e m) x = 0weighted_sum x (ordsucc m) e = weighted_sum x m e.
Let x, m, F and e be given.
Assume HxX: x X.
Assume HmO: m ω.
Assume HFsubP: F P.
Assume HvalR: ∀f : set, f Fapply_fun f x R.
Assume HcoefR: ∀f : set, f Fapply_fun coef_of f R.
Assume Hbij: bijection (ordsucc m) F e.
Assume Hval0: apply_fun (apply_fun e m) x = 0.
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (omega_nat_p m HmO).
We prove the intermediate claim Hefun: function_on e (ordsucc m) F.
An exact proof term for the current goal is (andEL (function_on e (ordsucc m) F) (∀y : set, y F∃x0 : set, x0 ordsucc m apply_fun e x0 = y (∀x' : set, x' ordsucc mapply_fun e x' = yx' = x0)) Hbij).
We prove the intermediate claim HekP_m: ∀k : set, k mapply_fun e k P.
Let k be given.
Assume HkM: k m.
We prove the intermediate claim HkDom: k ordsucc m.
An exact proof term for the current goal is (ordsuccI1 m k HkM).
We prove the intermediate claim HkF: apply_fun e k F.
An exact proof term for the current goal is (Hefun k HkDom).
An exact proof term for the current goal is (HFsubP (apply_fun e k) HkF).
We prove the intermediate claim HekValR_m: ∀k : set, k mapply_fun (apply_fun e k) x R.
Let k be given.
Assume HkM: k m.
We prove the intermediate claim HkDom: k ordsucc m.
An exact proof term for the current goal is (ordsuccI1 m k HkM).
We prove the intermediate claim HkF: apply_fun e k F.
An exact proof term for the current goal is (Hefun k HkDom).
An exact proof term for the current goal is (HvalR (apply_fun e k) HkF).
We prove the intermediate claim HekCoefR_m: ∀k : set, k mapply_fun coef_of (apply_fun e k) R.
Let k be given.
Assume HkM: k m.
We prove the intermediate claim HkDom: k ordsucc m.
An exact proof term for the current goal is (ordsuccI1 m k HkM).
We prove the intermediate claim HkF: apply_fun e k F.
An exact proof term for the current goal is (Hefun k HkDom).
An exact proof term for the current goal is (HcoefR (apply_fun e k) HkF).
We prove the intermediate claim HwsRall: ∀t : set, t ordsucc mweighted_sum x t e R.
An exact proof term for the current goal is (weighted_sum_prefix_in_R x m e HxX HmO HekP_m HekValR_m HekCoefR_m).
We prove the intermediate claim HwsR: weighted_sum x m e R.
An exact proof term for the current goal is (HwsRall m (ordsuccI2 m)).
We prove the intermediate claim HcoefLastR: apply_fun coef_of (apply_fun e m) R.
We prove the intermediate claim HmDom: m ordsucc m.
An exact proof term for the current goal is (ordsuccI2 m).
We prove the intermediate claim HmF: apply_fun e m F.
An exact proof term for the current goal is (Hefun m HmDom).
An exact proof term for the current goal is (HcoefR (apply_fun e m) HmF).
An exact proof term for the current goal is (weighted_sum_S_drop_zero x e m HmNat HwsR Hval0 HcoefLastR).
We prove the intermediate claim weighted_sum_drop_last2_first_if_zero_real: ∀x e m : set, x Xm ω(∀k : set, k ordsucc (ordsucc m)apply_fun e k P)(∀k : set, k ordsucc (ordsucc m)apply_fun coef_of (apply_fun e k) R)(∀k : set, k ordsucc (ordsucc m)apply_fun (apply_fun e k) x R)apply_fun (apply_fun e m) x = 0weighted_sum x (ordsucc (ordsucc m)) e = weighted_sum x (ordsucc m) (swap_last_two e m).
Let x, e and m be given.
Assume HxX: x X.
Assume HmO: m ω.
Assume HekP: ∀k : set, k ordsucc (ordsucc m)apply_fun e k P.
Assume HcoefR: ∀k : set, k ordsucc (ordsucc m)apply_fun coef_of (apply_fun e k) R.
Assume HvalR: ∀k : set, k ordsucc (ordsucc m)apply_fun (apply_fun e k) x R.
Assume Hval0: apply_fun (apply_fun e m) x = 0.
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (omega_nat_p m HmO).
We prove the intermediate claim HsmNat: nat_p (ordsucc m).
An exact proof term for the current goal is (nat_ordsucc m HmNat).
We prove the intermediate claim HdomO: ordsucc (ordsucc m) ω.
An exact proof term for the current goal is (omega_ordsucc (ordsucc m) (omega_ordsucc m HmO)).
We prove the intermediate claim HmIn1: m ordsucc m.
An exact proof term for the current goal is (ordsuccI2 m).
We prove the intermediate claim HmIn2: m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI1 (ordsucc m) m HmIn1).
We prove the intermediate claim HsmIn2: ordsucc m ordsucc (ordsucc m).
An exact proof term for the current goal is (ordsuccI2 (ordsucc m)).
We prove the intermediate claim Hws_mR: weighted_sum x m e R.
We prove the intermediate claim HmInS: m ordsucc (ordsucc (ordsucc m)).
An exact proof term for the current goal is (ordsuccI1 (ordsucc (ordsucc m)) m HmIn2).
An exact proof term for the current goal is (weighted_sum_prefix_in_R x (ordsucc (ordsucc m)) e HxX HdomO HekP HvalR HcoefR m HmInS).
We prove the intermediate claim Hcoef_mR: apply_fun coef_of (apply_fun e m) R.
An exact proof term for the current goal is (HcoefR m HmIn2).
We prove the intermediate claim Hval_mR: apply_fun (apply_fun e m) x R.
An exact proof term for the current goal is (HvalR m HmIn2).
We prove the intermediate claim Hcoef_smR: apply_fun coef_of (apply_fun e (ordsucc m)) R.
An exact proof term for the current goal is (HcoefR (ordsucc m) HsmIn2).
We prove the intermediate claim Hval_smR: apply_fun (apply_fun e (ordsucc m)) x R.
An exact proof term for the current goal is (HvalR (ordsucc m) HsmIn2).
We prove the intermediate claim Hswap: weighted_sum x (ordsucc (ordsucc m)) (swap_last_two e m) = weighted_sum x (ordsucc (ordsucc m)) e.
An exact proof term for the current goal is (weighted_sum_swap_last_two_real x e m HmNat Hws_mR Hcoef_mR Hval_mR Hcoef_smR Hval_smR).
We prove the intermediate claim Hdrop: weighted_sum x (ordsucc (ordsucc m)) (swap_last_two e m) = weighted_sum x (ordsucc m) (swap_last_two e m).
We prove the intermediate claim HsmInS: ordsucc m ordsucc (ordsucc (ordsucc m)).
An exact proof term for the current goal is (ordsuccI1 (ordsucc (ordsucc m)) (ordsucc m) HsmIn2).
We prove the intermediate claim HekPswap: ∀k : set, k ordsucc (ordsucc m)apply_fun (swap_last_two e m) k P.
Let k be given.
Assume Hk: k ordsucc (ordsucc m).
We prove the intermediate claim HkEq: apply_fun (swap_last_two e m) k = if k = m then apply_fun e (ordsucc m) else if k = ordsucc m then apply_fun e m else apply_fun e k.
An exact proof term for the current goal is (swap_last_two_apply e m k Hk).
rewrite the current goal using HkEq (from left to right).
Apply (xm (k = m)) to the current goal.
Assume Hkm: k = m.
rewrite the current goal using (If_i_1 (k = m) (apply_fun e (ordsucc m)) (if k = ordsucc m then apply_fun e m else apply_fun e k) Hkm) (from left to right).
An exact proof term for the current goal is (HekP (ordsucc m) HsmIn2).
Assume Hnkm: ¬ (k = m).
rewrite the current goal using (If_i_0 (k = m) (apply_fun e (ordsucc m)) (if k = ordsucc m then apply_fun e m else apply_fun e k) Hnkm) (from left to right).
Apply (xm (k = ordsucc m)) to the current goal.
Assume Hksm: k = ordsucc m.
rewrite the current goal using (If_i_1 (k = ordsucc m) (apply_fun e m) (apply_fun e k) Hksm) (from left to right).
An exact proof term for the current goal is (HekP m HmIn2).
Assume Hnksm: ¬ (k = ordsucc m).
rewrite the current goal using (If_i_0 (k = ordsucc m) (apply_fun e m) (apply_fun e k) Hnksm) (from left to right).
An exact proof term for the current goal is (HekP k Hk).
We prove the intermediate claim HvalRswap: ∀k : set, k ordsucc (ordsucc m)apply_fun (apply_fun (swap_last_two e m) k) x R.
Let k be given.
Assume Hk: k ordsucc (ordsucc m).
We prove the intermediate claim HkEq: apply_fun (swap_last_two e m) k = if k = m then apply_fun e (ordsucc m) else if k = ordsucc m then apply_fun e m else apply_fun e k.
An exact proof term for the current goal is (swap_last_two_apply e m k Hk).
rewrite the current goal using HkEq (from left to right).
Apply (xm (k = m)) to the current goal.
Assume Hkm: k = m.
rewrite the current goal using (If_i_1 (k = m) (apply_fun e (ordsucc m)) (if k = ordsucc m then apply_fun e m else apply_fun e k) Hkm) (from left to right).
An exact proof term for the current goal is (HvalR (ordsucc m) HsmIn2).
Assume Hnkm: ¬ (k = m).
rewrite the current goal using (If_i_0 (k = m) (apply_fun e (ordsucc m)) (if k = ordsucc m then apply_fun e m else apply_fun e k) Hnkm) (from left to right).
Apply (xm (k = ordsucc m)) to the current goal.
Assume Hksm: k = ordsucc m.
rewrite the current goal using (If_i_1 (k = ordsucc m) (apply_fun e m) (apply_fun e k) Hksm) (from left to right).
An exact proof term for the current goal is (HvalR m HmIn2).
Assume Hnksm: ¬ (k = ordsucc m).
rewrite the current goal using (If_i_0 (k = ordsucc m) (apply_fun e m) (apply_fun e k) Hnksm) (from left to right).
An exact proof term for the current goal is (HvalR k Hk).
We prove the intermediate claim HcoefRswap: ∀k : set, k ordsucc (ordsucc m)apply_fun coef_of (apply_fun (swap_last_two e m) k) R.
Let k be given.
Assume Hk: k ordsucc (ordsucc m).
We prove the intermediate claim HkEq: apply_fun (swap_last_two e m) k = if k = m then apply_fun e (ordsucc m) else if k = ordsucc m then apply_fun e m else apply_fun e k.
An exact proof term for the current goal is (swap_last_two_apply e m k Hk).
rewrite the current goal using HkEq (from left to right).
Apply (xm (k = m)) to the current goal.
Assume Hkm: k = m.
rewrite the current goal using (If_i_1 (k = m) (apply_fun e (ordsucc m)) (if k = ordsucc m then apply_fun e m else apply_fun e k) Hkm) (from left to right).
An exact proof term for the current goal is (HcoefR (ordsucc m) HsmIn2).
Assume Hnkm: ¬ (k = m).
rewrite the current goal using (If_i_0 (k = m) (apply_fun e (ordsucc m)) (if k = ordsucc m then apply_fun e m else apply_fun e k) Hnkm) (from left to right).
Apply (xm (k = ordsucc m)) to the current goal.
Assume Hksm: k = ordsucc m.
rewrite the current goal using (If_i_1 (k = ordsucc m) (apply_fun e m) (apply_fun e k) Hksm) (from left to right).
An exact proof term for the current goal is (HcoefR m HmIn2).
Assume Hnksm: ¬ (k = ordsucc m).
rewrite the current goal using (If_i_0 (k = ordsucc m) (apply_fun e m) (apply_fun e k) Hnksm) (from left to right).
An exact proof term for the current goal is (HcoefR k Hk).
We prove the intermediate claim Hws_smR': weighted_sum x (ordsucc m) (swap_last_two e m) R.
An exact proof term for the current goal is (weighted_sum_prefix_in_R x (ordsucc (ordsucc m)) (swap_last_two e m) HxX HdomO HekPswap HvalRswap HcoefRswap (ordsucc m) HsmInS).
We prove the intermediate claim HlastEq: apply_fun (apply_fun (swap_last_two e m) (ordsucc m)) x = 0.
An exact proof term for the current goal is (swap_last_two_apply e m (ordsucc m) HsmIn2).
rewrite the current goal using Hdef (from left to right).
We prove the intermediate claim Hneq: ¬ (ordsucc m = m).
Assume Heq: ordsucc m = m.
We prove the intermediate claim Hmm: m m.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 m).
An exact proof term for the current goal is ((In_irref m) Hmm).
rewrite the current goal using (If_i_0 (ordsucc m = m) (apply_fun e (ordsucc m)) (if ordsucc m = ordsucc m then apply_fun e m else apply_fun e (ordsucc m)) Hneq) (from left to right).
We prove the intermediate claim Hrefl: ordsucc m = ordsucc m.
Use reflexivity.
rewrite the current goal using (If_i_1 (ordsucc m = ordsucc m) (apply_fun e m) (apply_fun e (ordsucc m)) Hrefl) (from left to right).
An exact proof term for the current goal is Hval0.
We prove the intermediate claim HcoefLastR: apply_fun coef_of (apply_fun (swap_last_two e m) (ordsucc m)) R.
An exact proof term for the current goal is (swap_last_two_apply e m (ordsucc m) HsmIn2).
rewrite the current goal using Hdef (from left to right).
We prove the intermediate claim Hneq: ¬ (ordsucc m = m).
Assume Heq: ordsucc m = m.
We prove the intermediate claim Hmm: m m.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 m).
An exact proof term for the current goal is ((In_irref m) Hmm).
rewrite the current goal using (If_i_0 (ordsucc m = m) (apply_fun e (ordsucc m)) (if ordsucc m = ordsucc m then apply_fun e m else apply_fun e (ordsucc m)) Hneq) (from left to right).
We prove the intermediate claim Hrefl: ordsucc m = ordsucc m.
Use reflexivity.
rewrite the current goal using (If_i_1 (ordsucc m = ordsucc m) (apply_fun e m) (apply_fun e (ordsucc m)) Hrefl) (from left to right).
An exact proof term for the current goal is Hcoef_mR.
An exact proof term for the current goal is (weighted_sum_S_drop_zero x (swap_last_two e m) (ordsucc m) HsmNat Hws_smR' HlastEq HcoefLastR).
rewrite the current goal using Hswap (from right to left).
An exact proof term for the current goal is Hdrop.
We prove the intermediate claim weighted_sum_swap_adjacent_real: ∀x e n i : set, x Xn ωi nordsucc i n(∀k : set, k napply_fun e k P)(∀k : set, k napply_fun coef_of (apply_fun e k) R)(∀k : set, k napply_fun (apply_fun e k) x R)weighted_sum x n (swap_adjacent e i n) = weighted_sum x n e.
Let x, e, n and i be given.
Assume HxX: x X.
Assume HnO: n ω.
Assume HiIn: i n.
Assume HsiIn: ordsucc i n.
Assume HekP: ∀k : set, k napply_fun e k P.
Assume HcoefR: ∀k : set, k napply_fun coef_of (apply_fun e k) R.
Assume HvalR: ∀k : set, k napply_fun (apply_fun e k) x R.
We prove the intermediate claim HnNat: nat_p n.
An exact proof term for the current goal is (omega_nat_p n HnO).
Set Pn to be the term λt : set∀e0 i0 : set, i0 tordsucc i0 t(∀k : set, k tapply_fun e0 k P)(∀k : set, k tapply_fun coef_of (apply_fun e0 k) R)(∀k : set, k tapply_fun (apply_fun e0 k) x R)weighted_sum x t (swap_adjacent e0 i0 t) = weighted_sum x t e0.
We prove the intermediate claim HP0: Pn 0.
Let e0 and i0 be given.
Assume Hi0: i0 0.
Assume Hsi0: ordsucc i0 0.
Assume HekP0: ∀k : set, k 0apply_fun e0 k P.
Assume HcoefR0: ∀k : set, k 0apply_fun coef_of (apply_fun e0 k) R.
Assume HvalR0: ∀k : set, k 0apply_fun (apply_fun e0 k) x R.
Apply FalseE to the current goal.
An exact proof term for the current goal is (EmptyE i0 Hi0).
We prove the intermediate claim HPS: ∀t : set, nat_p tPn tPn (ordsucc t).
Let t be given.
Assume HtNat: nat_p t.
Assume IHt: Pn t.
We will prove Pn (ordsucc t).
Let e0 and i0 be given.
Assume HiS: i0 ordsucc t.
Assume HsiS: ordsucc i0 ordsucc t.
Assume HekP0: ∀k : set, k ordsucc tapply_fun e0 k P.
Assume HcoefR0: ∀k : set, k ordsucc tapply_fun coef_of (apply_fun e0 k) R.
Assume HvalR0: ∀k : set, k ordsucc tapply_fun (apply_fun e0 k) x R.
We prove the intermediate claim HtO: t ω.
An exact proof term for the current goal is (nat_p_omega t HtNat).
We prove the intermediate claim HitCase: i0 t i0 = t.
An exact proof term for the current goal is (ordsuccE t i0 HiS).
We prove the intermediate claim HiT: i0 t.
Apply (HitCase (i0 t)) to the current goal.
Assume HiInT: i0 t.
An exact proof term for the current goal is HiInT.
Assume HiEq: i0 = t.
Apply FalseE to the current goal.
We prove the intermediate claim Hst: ordsucc t ordsucc t.
rewrite the current goal using HiEq (from right to left) at position 1.
An exact proof term for the current goal is HsiS.
An exact proof term for the current goal is ((In_irref (ordsucc t)) Hst).
We prove the intermediate claim HsitCase: ordsucc i0 t ordsucc i0 = t.
An exact proof term for the current goal is (ordsuccE t (ordsucc i0) HsiS).
We prove the intermediate claim HekP_t: ∀k : set, k tapply_fun e0 k P.
Let k be given.
Assume Hk: k t.
An exact proof term for the current goal is (HekP0 k (ordsuccI1 t k Hk)).
We prove the intermediate claim HcoefR_t: ∀k : set, k tapply_fun coef_of (apply_fun e0 k) R.
Let k be given.
Assume Hk: k t.
An exact proof term for the current goal is (HcoefR0 k (ordsuccI1 t k Hk)).
We prove the intermediate claim HvalR_t: ∀k : set, k tapply_fun (apply_fun e0 k) x R.
Let k be given.
Assume Hk: k t.
An exact proof term for the current goal is (HvalR0 k (ordsuccI1 t k Hk)).
Apply (HsitCase (weighted_sum x (ordsucc t) (swap_adjacent e0 i0 (ordsucc t)) = weighted_sum x (ordsucc t) e0)) to the current goal.
Assume HsiT: ordsucc i0 t.
We prove the intermediate claim HtDom: t ordsucc t.
An exact proof term for the current goal is (ordsuccI2 t).
We prove the intermediate claim HwsL: weighted_sum x (ordsucc t) (swap_adjacent e0 i0 (ordsucc t)) = weighted_step x (swap_adjacent e0 i0 (ordsucc t)) t (weighted_sum x t (swap_adjacent e0 i0 (ordsucc t))).
An exact proof term for the current goal is (weighted_sum_S x (swap_adjacent e0 i0 (ordsucc t)) t HtNat).
We prove the intermediate claim HwsR: weighted_sum x (ordsucc t) e0 = weighted_step x e0 t (weighted_sum x t e0).
An exact proof term for the current goal is (weighted_sum_S x e0 t HtNat).
We prove the intermediate claim HeqDom: ∀k : set, k tapply_fun (swap_adjacent e0 i0 (ordsucc t)) k = apply_fun (swap_adjacent e0 i0 t) k.
Let k be given.
Assume Hk: k t.
We prove the intermediate claim HkS: k ordsucc t.
An exact proof term for the current goal is (ordsuccI1 t k Hk).
We prove the intermediate claim Hsa1: apply_fun (swap_adjacent e0 i0 (ordsucc t)) k = if k = i0 then apply_fun e0 (ordsucc i0) else if k = ordsucc i0 then apply_fun e0 i0 else apply_fun e0 k.
An exact proof term for the current goal is (swap_adjacent_apply e0 i0 (ordsucc t) k HkS).
We prove the intermediate claim Hsa2: apply_fun (swap_adjacent e0 i0 t) k = if k = i0 then apply_fun e0 (ordsucc i0) else if k = ordsucc i0 then apply_fun e0 i0 else apply_fun e0 k.
An exact proof term for the current goal is (swap_adjacent_apply e0 i0 t k Hk).
rewrite the current goal using Hsa1 (from left to right).
rewrite the current goal using Hsa2 (from left to right).
Use reflexivity.
We prove the intermediate claim HcongrDom: weighted_sum x t (swap_adjacent e0 i0 (ordsucc t)) = weighted_sum x t (swap_adjacent e0 i0 t).
An exact proof term for the current goal is (weighted_sum_congr x t (swap_adjacent e0 i0 (ordsucc t)) (swap_adjacent e0 i0 t) HtNat HeqDom).
We prove the intermediate claim HaccEq: weighted_sum x t (swap_adjacent e0 i0 (ordsucc t)) = weighted_sum x t e0.
rewrite the current goal using HcongrDom (from left to right).
An exact proof term for the current goal is (IHt e0 i0 HiT HsiT HekP_t HcoefR_t HvalR_t).
We prove the intermediate claim HtNei: ¬ (t = i0).
Assume Heq: t = i0.
We prove the intermediate claim HtIn: t t.
rewrite the current goal using Heq (from left to right) at position 1.
An exact proof term for the current goal is HiT.
An exact proof term for the current goal is ((In_irref t) HtIn).
We prove the intermediate claim HtNesi: ¬ (t = ordsucc i0).
Assume Heq: t = ordsucc i0.
We prove the intermediate claim HtIn: t t.
rewrite the current goal using Heq (from left to right) at position 1.
An exact proof term for the current goal is HsiT.
An exact proof term for the current goal is ((In_irref t) HtIn).
We prove the intermediate claim Hem: apply_fun (swap_adjacent e0 i0 (ordsucc t)) t = apply_fun e0 t.
We prove the intermediate claim Hsa: apply_fun (swap_adjacent e0 i0 (ordsucc t)) t = if t = i0 then apply_fun e0 (ordsucc i0) else if t = ordsucc i0 then apply_fun e0 i0 else apply_fun e0 t.
An exact proof term for the current goal is (swap_adjacent_apply e0 i0 (ordsucc t) t HtDom).
rewrite the current goal using Hsa (from left to right).
rewrite the current goal using (If_i_0 (t = i0) (apply_fun e0 (ordsucc i0)) (if t = ordsucc i0 then apply_fun e0 i0 else apply_fun e0 t) HtNei) (from left to right).
rewrite the current goal using (If_i_0 (t = ordsucc i0) (apply_fun e0 i0) (apply_fun e0 t) HtNesi) (from left to right).
Use reflexivity.
rewrite the current goal using HwsL (from left to right).
rewrite the current goal using HwsR (from left to right).
rewrite the current goal using HaccEq (from left to right).
An exact proof term for the current goal is (weighted_step_congr_e_at x (swap_adjacent e0 i0 (ordsucc t)) e0 t (weighted_sum x t e0) Hem).
Assume HsiEq: ordsucc i0 = t.
We prove the intermediate claim HiO: i0 ω.
We prove the intermediate claim HtSubO: t ω.
An exact proof term for the current goal is (omega_TransSet t HtO).
An exact proof term for the current goal is (HtSubO i0 HiT).
We prove the intermediate claim HiNat: nat_p i0.
An exact proof term for the current goal is (omega_nat_p i0 HiO).
We prove the intermediate claim HwsRall: ∀m : set, m ordsucc tweighted_sum x m e0 R.
An exact proof term for the current goal is (weighted_sum_prefix_in_R x t e0 HxX HtO HekP_t HvalR_t HcoefR_t).
We prove the intermediate claim HwsR_i: weighted_sum x i0 e0 R.
An exact proof term for the current goal is (HwsRall i0 (ordsuccI1 t i0 HiT)).
We prove the intermediate claim Hcoef_i: apply_fun coef_of (apply_fun e0 i0) R.
An exact proof term for the current goal is (HcoefR0 i0 (ordsuccI1 t i0 HiT)).
We prove the intermediate claim Hval_i: apply_fun (apply_fun e0 i0) x R.
An exact proof term for the current goal is (HvalR0 i0 (ordsuccI1 t i0 HiT)).
We prove the intermediate claim Hcoef_si: apply_fun coef_of (apply_fun e0 (ordsucc i0)) R.
rewrite the current goal using HsiEq (from left to right) at position 1.
An exact proof term for the current goal is (HcoefR0 t (ordsuccI2 t)).
We prove the intermediate claim Hval_si: apply_fun (apply_fun e0 (ordsucc i0)) x R.
rewrite the current goal using HsiEq (from left to right) at position 1.
An exact proof term for the current goal is (HvalR0 t (ordsuccI2 t)).
rewrite the current goal using HsiEq (from right to left).
An exact proof term for the current goal is (weighted_sum_swap_adjacent_last_real x e0 i0 HiNat HwsR_i Hcoef_i Hval_i Hcoef_si Hval_si).
We prove the intermediate claim HnP: Pn n.
An exact proof term for the current goal is (nat_ind Pn HP0 HPS n HnNat).
An exact proof term for the current goal is (HnP e i HiIn HsiIn HekP HcoefR HvalR).
We prove the intermediate claim weighted_sum_bubble_zero_right_real: ∀x e n i : set, x Xn ωi nordsucc i n(∀k : set, k napply_fun e k P)(∀k : set, k napply_fun coef_of (apply_fun e k) R)(∀k : set, k napply_fun (apply_fun e k) x R)apply_fun (apply_fun e i) x = 0weighted_sum x n e = weighted_sum x n (swap_adjacent e i n) apply_fun (apply_fun (swap_adjacent e i n) (ordsucc i)) x = 0.
Let x, e, n and i be given.
Assume HxX: x X.
Assume HnO: n ω.
Assume Hi: i n.
Assume Hsi: ordsucc i n.
Assume HekP: ∀k : set, k napply_fun e k P.
Assume HcoefR: ∀k : set, k napply_fun coef_of (apply_fun e k) R.
Assume HvalR: ∀k : set, k napply_fun (apply_fun e k) x R.
Assume Hzero: apply_fun (apply_fun e i) x = 0.
Apply andI to the current goal.
We prove the intermediate claim Hswap: weighted_sum x n (swap_adjacent e i n) = weighted_sum x n e.
An exact proof term for the current goal is (weighted_sum_swap_adjacent_real x e n i HxX HnO Hi Hsi HekP HcoefR HvalR).
rewrite the current goal using Hswap (from right to left).
Use reflexivity.
We prove the intermediate claim Hinner: apply_fun (swap_adjacent e i n) (ordsucc i) = apply_fun e i.
An exact proof term for the current goal is (swap_adjacent_at_succ e i n Hsi).
We prove the intermediate claim Houter: apply_fun (apply_fun (swap_adjacent e i n) (ordsucc i)) x = apply_fun (apply_fun e i) x.
rewrite the current goal using Hinner (from left to right).
Use reflexivity.
rewrite the current goal using Houter (from left to right).
An exact proof term for the current goal is Hzero.
We prove the intermediate claim weighted_sum_bijection_move_value_to_last_real: ∀x m F0 e flast : set, x Xm ωF0 P(∀f : set, f F0apply_fun f x R)(∀f : set, f F0apply_fun coef_of f R)bijection (ordsucc m) F0 eflast F0∃e' : set, bijection (ordsucc m) F0 e' weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e' apply_fun e' m = flast.
Let x, m, F0, e and flast be given.
Assume HxX: x X.
Assume HmO: m ω.
Assume HF0subP: F0 P.
Assume HvalR0: ∀f : set, f F0apply_fun f x R.
Assume HcoefR0: ∀f : set, f F0apply_fun coef_of f R.
Assume Hbij: bijection (ordsucc m) F0 e.
Assume HflastF0: flast F0.
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (omega_nat_p m HmO).
Set Pm to be the term λm0 : set∀F1 e0 fl : set, m0 ωF1 P(∀f : set, f F1apply_fun f x R)(∀f : set, f F1apply_fun coef_of f R)bijection (ordsucc m0) F1 e0fl F1∃e' : set, bijection (ordsucc m0) F1 e' weighted_sum x (ordsucc m0) e0 = weighted_sum x (ordsucc m0) e' apply_fun e' m0 = fl.
We prove the intermediate claim HP0: Pm 0.
Let F1, e0 and fl be given.
Assume H0O: 0 ω.
Assume HF1subP: F1 P.
Assume HvalR1: ∀f : set, f F1apply_fun f x R.
Assume HcoefR1: ∀f : set, f F1apply_fun coef_of f R.
Assume Hbij0: bijection (ordsucc 0) F1 e0.
Assume HflF1: fl F1.
Set e' to be the term e0.
We use e' 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 Hbij0.
Use reflexivity.
We prove the intermediate claim Hsurj: ∃k : set, k ordsucc 0 apply_fun e0 k = fl.
An exact proof term for the current goal is (bijection_surj (ordsucc 0) F1 e0 fl Hbij0 HflF1).
Apply Hsurj to the current goal.
Let k be given.
Assume Hkpack.
We prove the intermediate claim HkIn: k ordsucc 0.
An exact proof term for the current goal is (andEL (k ordsucc 0) (apply_fun e0 k = fl) Hkpack).
We prove the intermediate claim HkEq: apply_fun e0 k = fl.
An exact proof term for the current goal is (andER (k ordsucc 0) (apply_fun e0 k = fl) Hkpack).
We prove the intermediate claim HkCase: k 0 k = 0.
An exact proof term for the current goal is (ordsuccE 0 k HkIn).
We prove the intermediate claim Hk0: k = 0.
Apply (HkCase (k = 0)) to the current goal.
Assume HkIn0: k 0.
Apply FalseE to the current goal.
An exact proof term for the current goal is (EmptyE k HkIn0).
Assume HkEq0: k = 0.
An exact proof term for the current goal is HkEq0.
rewrite the current goal using Hk0 (from right to left) at position 1.
An exact proof term for the current goal is HkEq.
We prove the intermediate claim HPS: ∀t : set, nat_p tPm tPm (ordsucc t).
Let t be given.
Assume HtNat: nat_p t.
Assume IHt: Pm t.
We will prove Pm (ordsucc t).
Let F1, e0 and fl be given.
Assume Hm1O: ordsucc t ω.
Assume HF1subP: F1 P.
Assume HvalR1: ∀f : set, f F1apply_fun f x R.
Assume HcoefR1: ∀f : set, f F1apply_fun coef_of f R.
Assume HbijS: bijection (ordsucc (ordsucc t)) F1 e0.
Assume HflF1: fl F1.
Set m1 to be the term ordsucc t.
We prove the intermediate claim Hm1Def: m1 = ordsucc t.
Use reflexivity.
We prove the intermediate claim HtO: t ω.
An exact proof term for the current goal is (nat_p_omega t HtNat).
We prove the intermediate claim Hm1Nat: nat_p m1.
rewrite the current goal using Hm1Def (from left to right).
An exact proof term for the current goal is (nat_ordsucc t HtNat).
We prove the intermediate claim Hm1O2: m1 ω.
An exact proof term for the current goal is (nat_p_omega m1 Hm1Nat).
Set lastval to be the term apply_fun e0 m1.
We prove the intermediate claim HlastvalDef: lastval = apply_fun e0 m1.
Use reflexivity.
We prove the intermediate claim He0fun: function_on e0 (ordsucc m1) F1.
An exact proof term for the current goal is (andEL (function_on e0 (ordsucc m1) F1) (∀y : set, y F1∃x0 : set, x0 ordsucc m1 apply_fun e0 x0 = y (∀x' : set, x' ordsucc m1apply_fun e0 x' = yx' = x0)) HbijS).
We prove the intermediate claim HlastvalF1: lastval F1.
rewrite the current goal using HlastvalDef (from left to right).
An exact proof term for the current goal is (He0fun m1 (ordsuccI2 m1)).
Apply (xm (fl = lastval)) to the current goal.
Assume HeqLast: fl = lastval.
Set e' to be the term e0.
We use e' 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 HbijS.
Use reflexivity.
rewrite the current goal using HeqLast (from left to right).
rewrite the current goal using HlastvalDef (from left to right).
Use reflexivity.
Assume HneqLast: ¬ (fl = lastval).
We prove the intermediate claim HflNot: fl {lastval}.
Assume Hmem: fl {lastval}.
We prove the intermediate claim Heq: fl = lastval.
An exact proof term for the current goal is (SingE lastval fl Hmem).
An exact proof term for the current goal is (HneqLast Heq).
We prove the intermediate claim HflInDrop: fl (F1 {lastval}).
An exact proof term for the current goal is (setminusI F1 {lastval} fl HflF1 HflNot).
We prove the intermediate claim HbijDrop: bijection m1 (F1 {apply_fun e0 m1}) e0.
rewrite the current goal using Hm1Def (from right to left).
rewrite the current goal using HlastvalDef (from right to left).
An exact proof term for the current goal is (bijection_drop_last m1 F1 e0 Hm1O2 HbijS).
We prove the intermediate claim HbijDrop2: bijection m1 (F1 {lastval}) e0.
rewrite the current goal using HlastvalDef (from right to left) at position 1.
An exact proof term for the current goal is HbijDrop.
We prove the intermediate claim HsubP': (F1 {lastval}) P.
An exact proof term for the current goal is (Subq_tra (F1 {lastval}) F1 P (setminus_Subq F1 {lastval}) HF1subP).
We prove the intermediate claim HvalR': ∀f : set, f (F1 {lastval})apply_fun f x R.
Let f be given.
Assume Hf: f (F1 {lastval}).
An exact proof term for the current goal is (HvalR1 f (setminusE1 F1 {lastval} f Hf)).
We prove the intermediate claim HcoefR': ∀f : set, f (F1 {lastval})apply_fun coef_of f R.
Let f be given.
Assume Hf: f (F1 {lastval}).
An exact proof term for the current goal is (HcoefR1 f (setminusE1 F1 {lastval} f Hf)).
We prove the intermediate claim HmoveSmall: ∃e1 : set, bijection (ordsucc t) (F1 {lastval}) e1 weighted_sum x (ordsucc t) e0 = weighted_sum x (ordsucc t) e1 apply_fun e1 t = fl.
rewrite the current goal using Hm1Def (from right to left) at position 1.
An exact proof term for the current goal is (IHt (F1 {lastval}) e0 fl HtO HsubP' HvalR' HcoefR' HbijDrop2 HflInDrop).
Apply HmoveSmall to the current goal.
Let e1 be given.
Assume He1pack.
We prove the intermediate claim He1AB: bijection (ordsucc t) (F1 {lastval}) e1 weighted_sum x (ordsucc t) e0 = weighted_sum x (ordsucc t) e1.
An exact proof term for the current goal is (andEL (bijection (ordsucc t) (F1 {lastval}) e1 weighted_sum x (ordsucc t) e0 = weighted_sum x (ordsucc t) e1) (apply_fun e1 t = fl) He1pack).
We prove the intermediate claim He1Bij: bijection (ordsucc t) (F1 {lastval}) e1.
An exact proof term for the current goal is (andEL (bijection (ordsucc t) (F1 {lastval}) e1) (weighted_sum x (ordsucc t) e0 = weighted_sum x (ordsucc t) e1) He1AB).
We prove the intermediate claim HwsSmall: weighted_sum x (ordsucc t) e0 = weighted_sum x (ordsucc t) e1.
An exact proof term for the current goal is (andER (bijection (ordsucc t) (F1 {lastval}) e1) (weighted_sum x (ordsucc t) e0 = weighted_sum x (ordsucc t) e1) He1AB).
We prove the intermediate claim He1Val: apply_fun e1 t = fl.
An exact proof term for the current goal is (andER (bijection (ordsucc t) (F1 {lastval}) e1 weighted_sum x (ordsucc t) e0 = weighted_sum x (ordsucc t) e1) (apply_fun e1 t = fl) He1pack).
Set n to be the term ordsucc m1.
We prove the intermediate claim HnDef: n = ordsucc m1.
Use reflexivity.
We prove the intermediate claim HnO: n ω.
rewrite the current goal using HnDef (from left to right).
An exact proof term for the current goal is (nat_p_omega (ordsucc m1) (nat_ordsucc m1 Hm1Nat)).
We prove the intermediate claim HtInN: t n.
rewrite the current goal using HnDef (from left to right).
An exact proof term for the current goal is (ordsuccI1 m1 t (ordsuccI2 t)).
We prove the intermediate claim Hm1InN: m1 n.
rewrite the current goal using HnDef (from left to right).
An exact proof term for the current goal is (ordsuccI2 m1).
Set e2 to be the term graph n (λj : setif j = m1 then lastval else apply_fun e1 j).
We prove the intermediate claim He2Def: e2 = graph n (λj : setif j = m1 then lastval else apply_fun e1 j).
Use reflexivity.
We prove the intermediate claim He1fun0: function_on e1 (ordsucc t) (F1 {lastval}).
An exact proof term for the current goal is (andEL (function_on e1 (ordsucc t) (F1 {lastval})) (∀y : set, y (F1 {lastval})∃x0 : set, x0 ordsucc t apply_fun e1 x0 = y (∀x' : set, x' ordsucc tapply_fun e1 x' = yx' = x0)) He1Bij).
We prove the intermediate claim He2fun: function_on e2 n F1.
Let j be given.
Assume Hj: j n.
We prove the intermediate claim He2j: apply_fun e2 j = if j = m1 then lastval else apply_fun e1 j.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) j Hj).
We prove the intermediate claim HjS: j ordsucc m1.
rewrite the current goal using HnDef (from right to left) at position 1.
An exact proof term for the current goal is Hj.
We prove the intermediate claim HjCase: j m1 j = m1.
An exact proof term for the current goal is (ordsuccE m1 j HjS).
Apply (HjCase (apply_fun e2 j F1)) to the current goal.
Assume HjInM1: j m1.
rewrite the current goal using He2j (from left to right).
We prove the intermediate claim Hjne: ¬ (j = m1).
Assume Heq: j = m1.
We prove the intermediate claim Hmm: m1 m1.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is HjInM1.
An exact proof term for the current goal is ((In_irref m1) Hmm).
rewrite the current goal using (If_i_0 (j = m1) lastval (apply_fun e1 j) Hjne) (from left to right).
We prove the intermediate claim HjInDom: j ordsucc t.
rewrite the current goal using Hm1Def (from right to left) at position 1.
An exact proof term for the current goal is HjInM1.
We prove the intermediate claim HimgDrop: apply_fun e1 j (F1 {lastval}).
An exact proof term for the current goal is (He1fun0 j HjInDom).
An exact proof term for the current goal is (setminusE1 F1 {lastval} (apply_fun e1 j) HimgDrop).
Assume HjEqM1: j = m1.
rewrite the current goal using He2j (from left to right).
rewrite the current goal using (If_i_1 (j = m1) lastval (apply_fun e1 j) HjEqM1) (from left to right).
An exact proof term for the current goal is HlastvalF1.
We prove the intermediate claim He2m1: apply_fun e2 m1 = lastval.
We prove the intermediate claim Hm1In: m1 n.
An exact proof term for the current goal is Hm1InN.
We prove the intermediate claim He2m1': apply_fun e2 m1 = if m1 = m1 then lastval else apply_fun e1 m1.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) m1 Hm1In).
rewrite the current goal using He2m1' (from left to right).
We prove the intermediate claim Hrefl: m1 = m1.
Use reflexivity.
rewrite the current goal using (If_i_1 (m1 = m1) lastval (apply_fun e1 m1) Hrefl) (from left to right).
Use reflexivity.
We prove the intermediate claim He2t: apply_fun e2 t = fl.
We prove the intermediate claim HtIn: t n.
An exact proof term for the current goal is HtInN.
We prove the intermediate claim He2t': apply_fun e2 t = if t = m1 then lastval else apply_fun e1 t.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) t HtIn).
rewrite the current goal using He2t' (from left to right).
We prove the intermediate claim HtNe: ¬ (t = m1).
Assume Heq: t = m1.
We prove the intermediate claim Hmm: 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) Hmm).
rewrite the current goal using (If_i_0 (t = m1) lastval (apply_fun e1 t) HtNe) (from left to right).
rewrite the current goal using He1Val (from left to right).
Use reflexivity.
We prove the intermediate claim He2bij: bijection n F1 e2.
We will prove function_on e2 n F1 (∀y : set, y F1∃x0 : set, x0 n apply_fun e2 x0 = y (∀x' : set, x' napply_fun e2 x' = yx' = x0)).
Apply andI to the current goal.
An exact proof term for the current goal is He2fun.
Let y be given.
Assume HyF1: y F1.
Apply (xm (y = lastval)) to the current goal.
Assume HyEq: y = lastval.
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 Hm1InN.
rewrite the current goal using HyEq (from left to right).
An exact proof term for the current goal is He2m1.
Let x' be given.
Assume Hx'n: x' n.
Assume Hx'Eq: apply_fun e2 x' = y.
We prove the intermediate claim Hx'nS: x' ordsucc m1.
rewrite the current goal using HnDef (from right to left) at position 1.
An exact proof term for the current goal is Hx'n.
We prove the intermediate claim Hx'Case: x' m1 x' = m1.
An exact proof term for the current goal is (ordsuccE m1 x' Hx'nS).
Apply (Hx'Case (x' = m1)) to the current goal.
Assume Hx'InM1: x' m1.
Apply FalseE to the current goal.
We prove the intermediate claim Hx'nm1: ¬ (x' = m1).
Assume Heq: x' = m1.
We prove the intermediate claim Hmm: m1 m1.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is Hx'InM1.
An exact proof term for the current goal is ((In_irref m1) Hmm).
We prove the intermediate claim He2x': apply_fun e2 x' = if x' = m1 then lastval else apply_fun e1 x'.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) x' Hx'n).
We prove the intermediate claim Hx'EqIf: (if x' = m1 then lastval else apply_fun e1 x') = y.
rewrite the current goal using He2x' (from right to left) at position 1.
An exact proof term for the current goal is Hx'Eq.
We prove the intermediate claim He1EqY: apply_fun e1 x' = y.
rewrite the current goal using (If_i_0 (x' = m1) lastval (apply_fun e1 x') Hx'nm1) (from right to left) at position 1.
An exact proof term for the current goal is Hx'EqIf.
We prove the intermediate claim He1EqLast: apply_fun e1 x' = lastval.
rewrite the current goal using HyEq (from right to left).
An exact proof term for the current goal is He1EqY.
We prove the intermediate claim Hx'dom: x' ordsucc t.
rewrite the current goal using Hm1Def (from right to left) at position 1.
An exact proof term for the current goal is Hx'InM1.
We prove the intermediate claim HimgDrop: apply_fun e1 x' (F1 {lastval}).
An exact proof term for the current goal is (He1fun0 x' Hx'dom).
We prove the intermediate claim HimgNot: apply_fun e1 x' {lastval}.
An exact proof term for the current goal is (andER (apply_fun e1 x' F1) (apply_fun e1 x' {lastval}) (setminusE F1 {lastval} (apply_fun e1 x') HimgDrop)).
We prove the intermediate claim Hmem: apply_fun e1 x' {lastval}.
rewrite the current goal using He1EqLast (from left to right).
An exact proof term for the current goal is (SingI lastval).
An exact proof term for the current goal is (HimgNot Hmem).
Assume Hx'EqM1: x' = m1.
An exact proof term for the current goal is Hx'EqM1.
Assume HyNeq: ¬ (y = lastval).
We prove the intermediate claim HyNot: y {lastval}.
Assume HyMem: y {lastval}.
We prove the intermediate claim HyEq2: y = lastval.
An exact proof term for the current goal is (SingE lastval y HyMem).
An exact proof term for the current goal is (HyNeq HyEq2).
We prove the intermediate claim HyDrop: y (F1 {lastval}).
An exact proof term for the current goal is (setminusI F1 {lastval} y HyF1 HyNot).
We prove the intermediate claim He1uniq: ∃x0 : set, x0 ordsucc t apply_fun e1 x0 = y (∀x'' : set, x'' ordsucc tapply_fun e1 x'' = yx'' = x0).
An exact proof term for the current goal is ((andER (function_on e1 (ordsucc t) (F1 {lastval})) (∀y0 : set, y0 (F1 {lastval})∃x0 : set, x0 ordsucc t apply_fun e1 x0 = y0 (∀x' : set, x' ordsucc tapply_fun e1 x' = y0x' = x0)) He1Bij) y HyDrop).
Apply He1uniq to the current goal.
Let x0 be given.
Assume Hx0pack.
We prove the intermediate claim Hx0AB: x0 ordsucc t apply_fun e1 x0 = y.
An exact proof term for the current goal is (andEL (x0 ordsucc t apply_fun e1 x0 = y) (∀x'' : set, x'' ordsucc tapply_fun e1 x'' = yx'' = x0) Hx0pack).
We prove the intermediate claim Hx0Dom: x0 ordsucc t.
An exact proof term for the current goal is (andEL (x0 ordsucc t) (apply_fun e1 x0 = y) Hx0AB).
We prove the intermediate claim He1x0: apply_fun e1 x0 = y.
An exact proof term for the current goal is (andER (x0 ordsucc t) (apply_fun e1 x0 = y) Hx0AB).
We prove the intermediate claim HuniqE1: ∀x'' : set, x'' ordsucc tapply_fun e1 x'' = yx'' = x0.
An exact proof term for the current goal is (andER (x0 ordsucc t apply_fun e1 x0 = y) (∀x'' : set, x'' ordsucc tapply_fun e1 x'' = yx'' = x0) Hx0pack).
We prove the intermediate claim Hx0InM1: x0 m1.
rewrite the current goal using Hm1Def (from left to right).
An exact proof term for the current goal is Hx0Dom.
We prove the intermediate claim Hx0InN: x0 n.
rewrite the current goal using HnDef (from left to right).
An exact proof term for the current goal is (ordsuccI1 m1 x0 Hx0InM1).
We prove the intermediate claim Hx0nm1: ¬ (x0 = m1).
Assume Heq: x0 = m1.
We prove the intermediate claim Hmm: m1 m1.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is Hx0InM1.
An exact proof term for the current goal is ((In_irref m1) Hmm).
We use x0 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 Hx0InN.
We prove the intermediate claim He2x0: apply_fun e2 x0 = if x0 = m1 then lastval else apply_fun e1 x0.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) x0 Hx0InN).
rewrite the current goal using He2x0 (from left to right).
rewrite the current goal using (If_i_0 (x0 = m1) lastval (apply_fun e1 x0) Hx0nm1) (from left to right).
An exact proof term for the current goal is He1x0.
Let x' be given.
Assume Hx'n: x' n.
Assume Hx'Eq: apply_fun e2 x' = y.
We prove the intermediate claim Hx'nS: x' ordsucc m1.
rewrite the current goal using HnDef (from right to left) at position 1.
An exact proof term for the current goal is Hx'n.
We prove the intermediate claim Hx'Case: x' m1 x' = m1.
An exact proof term for the current goal is (ordsuccE m1 x' Hx'nS).
Apply (Hx'Case (x' = x0)) to the current goal.
Assume Hx'InM1: x' m1.
We prove the intermediate claim Hx'nm1: ¬ (x' = m1).
Assume Heq: x' = m1.
We prove the intermediate claim Hmm: m1 m1.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is Hx'InM1.
An exact proof term for the current goal is ((In_irref m1) Hmm).
We prove the intermediate claim He2x_x': apply_fun e2 x' = if x' = m1 then lastval else apply_fun e1 x'.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) x' Hx'n).
We prove the intermediate claim Hx'EqIf: (if x' = m1 then lastval else apply_fun e1 x') = y.
rewrite the current goal using He2x_x' (from right to left) at position 1.
An exact proof term for the current goal is Hx'Eq.
We prove the intermediate claim He1EqY: apply_fun e1 x' = y.
rewrite the current goal using (If_i_0 (x' = m1) lastval (apply_fun e1 x') Hx'nm1) (from right to left) at position 1.
An exact proof term for the current goal is Hx'EqIf.
We prove the intermediate claim Hx'dom: x' ordsucc t.
rewrite the current goal using Hm1Def (from right to left) at position 1.
An exact proof term for the current goal is Hx'InM1.
An exact proof term for the current goal is (HuniqE1 x' Hx'dom He1EqY).
Assume Hx'EqM1: x' = m1.
Apply FalseE to the current goal.
We prove the intermediate claim He2x_m1: apply_fun e2 x' = if x' = m1 then lastval else apply_fun e1 x'.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) x' Hx'n).
We prove the intermediate claim Hx'EqIf_m1: (if x' = m1 then lastval else apply_fun e1 x') = y.
rewrite the current goal using He2x_m1 (from right to left) at position 1.
An exact proof term for the current goal is Hx'Eq.
We prove the intermediate claim HyEq2: y = lastval.
We prove the intermediate claim Htmp: lastval = y.
rewrite the current goal using (If_i_1 (x' = m1) lastval (apply_fun e1 x') Hx'EqM1) (from right to left) at position 1.
An exact proof term for the current goal is Hx'EqIf_m1.
Use symmetry.
An exact proof term for the current goal is Htmp.
An exact proof term for the current goal is (HyNeq HyEq2).
We prove the intermediate claim Hws_m1_e2e1: weighted_sum x m1 e2 = weighted_sum x m1 e1.
Apply (weighted_sum_congr x m1 e2 e1 Hm1Nat) to the current goal.
Let k be given.
Assume HkIn: k m1.
We prove the intermediate claim HkInN: k n.
rewrite the current goal using HnDef (from left to right).
An exact proof term for the current goal is (ordsuccI1 m1 k HkIn).
We prove the intermediate claim He2k: apply_fun e2 k = if k = m1 then lastval else apply_fun e1 k.
rewrite the current goal using He2Def (from left to right).
An exact proof term for the current goal is (apply_fun_graph n (λj0 : setif j0 = m1 then lastval else apply_fun e1 j0) k HkInN).
We prove the intermediate claim Hkne: ¬ (k = m1).
Assume Heq: k = m1.
We prove the intermediate claim Hmm: m1 m1.
rewrite the current goal using Heq (from right to left) at position 1.
An exact proof term for the current goal is HkIn.
An exact proof term for the current goal is ((In_irref m1) Hmm).
rewrite the current goal using He2k (from left to right).
rewrite the current goal using (If_i_0 (k = m1) lastval (apply_fun e1 k) Hkne) (from left to right).
Use reflexivity.
We prove the intermediate claim Hws_m1_e0e2: weighted_sum x m1 e0 = weighted_sum x m1 e2.
rewrite the current goal using HwsSmall (from left to right).
rewrite the current goal using Hws_m1_e2e1 (from right to left) at position 1.
Use reflexivity.
We prove the intermediate claim Hws_e0_e2: weighted_sum x n e0 = weighted_sum x n e2.
rewrite the current goal using HnDef (from left to right).
We prove the intermediate claim Hws0: weighted_sum x (ordsucc m1) e0 = weighted_step x e0 m1 (weighted_sum x m1 e0).
An exact proof term for the current goal is (weighted_sum_S x e0 m1 Hm1Nat).
We prove the intermediate claim Hws2: weighted_sum x (ordsucc m1) e2 = weighted_step x e2 m1 (weighted_sum x m1 e2).
An exact proof term for the current goal is (weighted_sum_S x e2 m1 Hm1Nat).
rewrite the current goal using Hws0 (from left to right).
rewrite the current goal using Hws2 (from left to right).
We prove the intermediate claim Hacc: weighted_sum x m1 e0 = weighted_sum x m1 e2.
An exact proof term for the current goal is Hws_m1_e0e2.
We prove the intermediate claim HstepAcc: weighted_step x e0 m1 (weighted_sum x m1 e0) = weighted_step x e0 m1 (weighted_sum x m1 e2).
An exact proof term for the current goal is (weighted_step_congr_acc x e0 m1 (weighted_sum x m1 e0) (weighted_sum x m1 e2) Hacc).
rewrite the current goal using HstepAcc (from left to right).
We prove the intermediate claim Hem: apply_fun e0 m1 = apply_fun e2 m1.
rewrite the current goal using He2m1 (from left to right).
rewrite the current goal using HlastvalDef (from right to left) at position 1.
Use reflexivity.
An exact proof term for the current goal is (weighted_step_congr_e_at x e0 e2 m1 (weighted_sum x m1 e2) Hem).
We prove the intermediate claim He2kP: ∀k : set, k napply_fun e2 k P.
Let k be given.
Assume Hk: k n.
We prove the intermediate claim HkF1: apply_fun e2 k F1.
An exact proof term for the current goal is (He2fun k Hk).
An exact proof term for the current goal is (HF1subP (apply_fun e2 k) HkF1).
We prove the intermediate claim He2coefR: ∀k : set, k napply_fun coef_of (apply_fun e2 k) R.
Let k be given.
Assume Hk: k n.
We prove the intermediate claim HkF1: apply_fun e2 k F1.
An exact proof term for the current goal is (He2fun k Hk).
An exact proof term for the current goal is (HcoefR1 (apply_fun e2 k) HkF1).
We prove the intermediate claim He2valR: ∀k : set, k napply_fun (apply_fun e2 k) x R.
Let k be given.
Assume Hk: k n.
We prove the intermediate claim HkF1: apply_fun e2 k F1.
An exact proof term for the current goal is (He2fun k Hk).
An exact proof term for the current goal is (HvalR1 (apply_fun e2 k) HkF1).
Set e' to be the term swap_adjacent e2 t n.
We prove the intermediate claim He'Def: e' = swap_adjacent e2 t n.
Use reflexivity.
We use e' 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 (bijection_swap_adjacent F1 e2 t n HtInN Hm1InN He2bij).
We prove the intermediate claim Hswap: weighted_sum x n e' = weighted_sum x n e2.
An exact proof term for the current goal is (weighted_sum_swap_adjacent_real x e2 n t HxX HnO HtInN Hm1InN He2kP He2coefR He2valR).
We prove the intermediate claim HswapInv: weighted_sum x n e2 = weighted_sum x n e'.
rewrite the current goal using Hswap (from right to left).
Use reflexivity.
An exact proof term for the current goal is (eq_i_tra (weighted_sum x n e0) (weighted_sum x n e2) (weighted_sum x n e') Hws_e0_e2 HswapInv).
rewrite the current goal using He'Def (from left to right).
We prove the intermediate claim HstInN: ordsucc t n.
rewrite the current goal using Hm1Def (from right to left) at position 1.
An exact proof term for the current goal is Hm1InN.
rewrite the current goal using Hm1Def (from left to right) at position 1.
We prove the intermediate claim Hsa: apply_fun (swap_adjacent e2 t n) (ordsucc t) = if ordsucc t = t then apply_fun e2 (ordsucc t) else if ordsucc t = ordsucc t then apply_fun e2 t else apply_fun e2 (ordsucc t).
An exact proof term for the current goal is (swap_adjacent_apply e2 t n (ordsucc t) HstInN).
rewrite the current goal using Hsa (from left to right).
We prove the intermediate claim Hneq: ¬ (ordsucc t = t).
Assume Heq: ordsucc t = t.
We prove the intermediate claim Htt: t t.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 t).
An exact proof term for the current goal is ((In_irref t) Htt).
rewrite the current goal using (If_i_0 (ordsucc t = t) (apply_fun e2 (ordsucc t)) (if ordsucc t = ordsucc t then apply_fun e2 t else apply_fun e2 (ordsucc t)) Hneq) (from left to right).
We prove the intermediate claim Hrefl2: ordsucc t = ordsucc t.
Use reflexivity.
rewrite the current goal using (If_i_1 (ordsucc t = ordsucc t) (apply_fun e2 t) (apply_fun e2 (ordsucc t)) Hrefl2) (from left to right).
An exact proof term for the current goal is He2t.
We prove the intermediate claim HmP: Pm m.
An exact proof term for the current goal is (nat_ind Pm HP0 HPS m HmNat).
An exact proof term for the current goal is (HmP F0 e flast HmO HF0subP HvalR0 HcoefR0 Hbij HflastF0).
We prove the intermediate claim weighted_sum_bijection_remove_one_zero_real: ∀x m F e f : set, x Xm ωF P(∀g : set, g Fapply_fun g x R)(∀g : set, g Fapply_fun coef_of g R)bijection (ordsucc m) F ef Fapply_fun f x = 0∃e' : set, bijection m (F {f}) e' weighted_sum x (ordsucc m) e = weighted_sum x m e'.
Let x, m, F, e and f be given.
Assume HxX: x X.
Assume HmO: m ω.
Assume HFsubP: F P.
Assume HvalR: ∀g : set, g Fapply_fun g x R.
Assume HcoefR: ∀g : set, g Fapply_fun coef_of g R.
Assume Hbij: bijection (ordsucc m) F e.
Assume HfF: f F.
Assume Hfx0: apply_fun f x = 0.
We prove the intermediate claim Hmove: ∃e2 : set, bijection (ordsucc m) F e2 weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e2 apply_fun e2 m = f.
An exact proof term for the current goal is (weighted_sum_bijection_move_value_to_last_real x m F e f HxX HmO HFsubP HvalR HcoefR Hbij HfF).
Apply Hmove to the current goal.
Let e2 be given.
Assume He2pack.
We prove the intermediate claim He2left: bijection (ordsucc m) F e2 weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e2.
An exact proof term for the current goal is (andEL (bijection (ordsucc m) F e2 weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e2) (apply_fun e2 m = f) He2pack).
We prove the intermediate claim Hbij2: bijection (ordsucc m) F e2.
An exact proof term for the current goal is (andEL (bijection (ordsucc m) F e2) (weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e2) He2left).
We prove the intermediate claim HwsEq: weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e2.
An exact proof term for the current goal is (andER (bijection (ordsucc m) F e2) (weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e2) He2left).
We prove the intermediate claim He2m: apply_fun e2 m = f.
An exact proof term for the current goal is (andER (bijection (ordsucc m) F e2 weighted_sum x (ordsucc m) e = weighted_sum x (ordsucc m) e2) (apply_fun e2 m = f) He2pack).
We prove the intermediate claim Hval0last: apply_fun (apply_fun e2 m) x = 0.
rewrite the current goal using He2m (from left to right).
An exact proof term for the current goal is Hfx0.
We prove the intermediate claim Hdrop: weighted_sum x (ordsucc m) e2 = weighted_sum x m e2.
An exact proof term for the current goal is (weighted_sum_drop_last_of_bijection_zero_real x m F e2 HxX HmO HFsubP HvalR HcoefR Hbij2 Hval0last).
We prove the intermediate claim HbijDrop0: bijection m (F {apply_fun e2 m}) e2.
An exact proof term for the current goal is (bijection_drop_last m F e2 HmO Hbij2).
We prove the intermediate claim HbijDrop: bijection m (F {f}) e2.
rewrite the current goal using He2m (from right to left).
An exact proof term for the current goal is HbijDrop0.
We use e2 to witness the existential quantifier.
Apply andI to the current goal.
An exact proof term for the current goal is HbijDrop.
rewrite the current goal using HwsEq (from left to right).
An exact proof term for the current goal is Hdrop.
We prove the intermediate claim weighted_sum_bijection_indep_real: ∀x n F e1 e2 : set, x Xn ωF P(∀f : set, f Fapply_fun f x R)(∀f : set, f Fapply_fun coef_of f R)bijection n F e1bijection n F e2weighted_sum x n e1 = weighted_sum x n e2.
Let x, n, F, e1 and e2 be given.
Assume HxX: x X.
Assume HnO: n ω.
Assume HFsubP: F P.
Assume HvalR_F: ∀f : set, f Fapply_fun f x R.
Assume HcoefR_F: ∀f : set, f Fapply_fun coef_of f R.
Assume Hbij1: bijection n F e1.
Assume Hbij2: bijection n F e2.
We prove the intermediate claim HnNat: nat_p n.
An exact proof term for the current goal is (omega_nat_p n HnO).
Set Pws to be the term λt : set∀F0 eA eB : set, F0 P(∀f : set, f F0apply_fun f x R)(∀f : set, f F0apply_fun coef_of f R)bijection t F0 eAbijection t F0 eBweighted_sum x t eA = weighted_sum x t eB.
We prove the intermediate claim HP0: Pws 0.
Let F0, eA and eB be given.
Assume HF0subP: F0 P.
Assume HvalR0: ∀f : set, f F0apply_fun f x R.
Assume HcoefR0: ∀f : set, f F0apply_fun coef_of f R.
Assume HbijA: bijection 0 F0 eA.
Assume HbijB: bijection 0 F0 eB.
rewrite the current goal using (weighted_sum_0 x eA) (from left to right).
rewrite the current goal using (weighted_sum_0 x eB) (from left to right).
Use reflexivity.
We prove the intermediate claim HPS: ∀m : set, nat_p mPws mPws (ordsucc m).
Let m be given.
Assume HmNat: nat_p m.
Assume IHm: Pws m.
We will prove Pws (ordsucc m).
Let F0, eA and eB be given.
Assume HF0subP: F0 P.
Assume HvalR0: ∀f : set, f F0apply_fun f x R.
Assume HcoefR0: ∀f : set, f F0apply_fun coef_of f R.
Assume HbijA: bijection (ordsucc m) F0 eA.
Assume HbijB: bijection (ordsucc m) F0 eB.
We prove the intermediate claim HmO: m ω.
An exact proof term for the current goal is (nat_p_omega m HmNat).
Set flast to be the term apply_fun eA m.
We prove the intermediate claim HflastDef: flast = apply_fun eA m.
Use reflexivity.
We prove the intermediate claim HeAfun: function_on eA (ordsucc m) F0.
An exact proof term for the current goal is (andEL (function_on eA (ordsucc m) F0) (∀y : set, y F0∃x0 : set, x0 ordsucc m apply_fun eA x0 = y (∀x' : set, x' ordsucc mapply_fun eA x' = yx' = x0)) HbijA).
We prove the intermediate claim HflastF0: flast F0.
An exact proof term for the current goal is (HeAfun m (ordsuccI2 m)).
We prove the intermediate claim Hmove: ∃eB' : set, bijection (ordsucc m) F0 eB' weighted_sum x (ordsucc m) eB = weighted_sum x (ordsucc m) eB' apply_fun eB' m = flast.
An exact proof term for the current goal is (weighted_sum_bijection_move_value_to_last_real x m F0 eB flast HxX HmO HF0subP HvalR0 HcoefR0 HbijB HflastF0).
Apply Hmove to the current goal.
Let eB' be given.
Assume HB'pack.
We prove the intermediate claim HAB: bijection (ordsucc m) F0 eB' weighted_sum x (ordsucc m) eB = weighted_sum x (ordsucc m) eB'.
An exact proof term for the current goal is (andEL (bijection (ordsucc m) F0 eB' weighted_sum x (ordsucc m) eB = weighted_sum x (ordsucc m) eB') (apply_fun eB' m = flast) HB'pack).
We prove the intermediate claim HbijB': bijection (ordsucc m) F0 eB'.
An exact proof term for the current goal is (andEL (bijection (ordsucc m) F0 eB') (weighted_sum x (ordsucc m) eB = weighted_sum x (ordsucc m) eB') HAB).
We prove the intermediate claim HwsBB': weighted_sum x (ordsucc m) eB = weighted_sum x (ordsucc m) eB'.
An exact proof term for the current goal is (andER (bijection (ordsucc m) F0 eB') (weighted_sum x (ordsucc m) eB = weighted_sum x (ordsucc m) eB') HAB).
We prove the intermediate claim HlastEq: apply_fun eB' m = flast.
An exact proof term for the current goal is (andER (bijection (ordsucc m) F0 eB' weighted_sum x (ordsucc m) eB = weighted_sum x (ordsucc m) eB') (apply_fun eB' m = flast) HB'pack).
We prove the intermediate claim HsubP': (F0 {flast}) P.
An exact proof term for the current goal is (Subq_tra (F0 {flast}) F0 P (setminus_Subq F0 {flast}) HF0subP).
We prove the intermediate claim HvalR': ∀f : set, f (F0 {flast})apply_fun f x R.
Let f be given.
Assume Hf: f (F0 {flast}).
An exact proof term for the current goal is (HvalR0 f (setminusE1 F0 {flast} f Hf)).
We prove the intermediate claim HcoefR': ∀f : set, f (F0 {flast})apply_fun coef_of f R.
Let f be given.
Assume Hf: f (F0 {flast}).
An exact proof term for the current goal is (HcoefR0 f (setminusE1 F0 {flast} f Hf)).
We prove the intermediate claim HbijA0: bijection m (F0 {flast}) eA.
rewrite the current goal using HflastDef (from left to right).
An exact proof term for the current goal is (bijection_drop_last m F0 eA HmO HbijA).
We prove the intermediate claim HbijB0: bijection m (F0 {flast}) eB'.
rewrite the current goal using HlastEq (from right to left).
An exact proof term for the current goal is (bijection_drop_last m F0 eB' HmO HbijB').
We prove the intermediate claim HaccEq: weighted_sum x m eA = weighted_sum x m eB'.
An exact proof term for the current goal is (IHm (F0 {flast}) eA eB' HsubP' HvalR' HcoefR' HbijA0 HbijB0).
We prove the intermediate claim HgoalB': weighted_sum x (ordsucc m) eA = weighted_sum x (ordsucc m) eB'.
We prove the intermediate claim HwsA: weighted_sum x (ordsucc m) eA = weighted_step x eA m (weighted_sum x m eA).
An exact proof term for the current goal is (weighted_sum_S x eA m HmNat).
We prove the intermediate claim HwsB: weighted_sum x (ordsucc m) eB' = weighted_step x eB' m (weighted_sum x m eB').
An exact proof term for the current goal is (weighted_sum_S x eB' m HmNat).
rewrite the current goal using HwsA (from left to right).
rewrite the current goal using HwsB (from left to right).
We prove the intermediate claim HeqEm: apply_fun eA m = apply_fun eB' m.
rewrite the current goal using HflastDef (from right to left) at position 1.
rewrite the current goal using HlastEq (from left to right).
Use reflexivity.
We prove the intermediate claim HstepAcc: weighted_step x eA m (weighted_sum x m eA) = weighted_step x eA m (weighted_sum x m eB').
An exact proof term for the current goal is (weighted_step_congr_acc x eA m (weighted_sum x m eA) (weighted_sum x m eB') HaccEq).
We prove the intermediate claim HstepE: weighted_step x eA m (weighted_sum x m eB') = weighted_step x eB' m (weighted_sum x m eB').
An exact proof term for the current goal is (weighted_step_congr_e_at x eA eB' m (weighted_sum x m eB') HeqEm).
rewrite the current goal using HstepAcc (from left to right).
rewrite the current goal using HstepE (from left to right).
Use reflexivity.
We prove the intermediate claim Hsubst: ∀S T : set, S = Tweighted_sum x (ordsucc m) eA = Tweighted_sum x (ordsucc m) eA = S.
Let S and T be given.
Assume HeqST: S = T.
Assume HT: weighted_sum x (ordsucc m) eA = T.
We will prove weighted_sum x (ordsucc m) eA = S.
rewrite the current goal using HeqST (from left to right).
An exact proof term for the current goal is HT.
An exact proof term for the current goal is (Hsubst (weighted_sum x (ordsucc m) eB) (weighted_sum x (ordsucc m) eB') HwsBB' HgoalB').
We prove the intermediate claim HnP: Pws n.
An exact proof term for the current goal is (nat_ind Pws HP0 HPS n HnNat).
An exact proof term for the current goal is (HnP F e1 e2 HFsubP HvalR_F HcoefR_F Hbij1 Hbij2).
We prove the intermediate claim weighted_sum_le_eps_on_point: ∀A x F n e p : set, A Cx Xx Afinite FF P(∀f : set, f Papply_fun f x 0f F)n ωbijection n F efunction_on p (ordsucc n) Rapply_fun p Empty = 0(∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))apply_fun p n = 1Rle (weighted_sum x n e) (apply_fun eps A).
Let A, x, F, n, e and p be given.
Assume HA: A C.
Assume HxX: x X.
Assume HxA: x A.
Assume HFfin: finite F.
Assume HFsubP: F P.
Assume Hsupp: ∀f : set, f Papply_fun f x 0f F.
Assume HnO: n ω.
Assume Hbij: bijection n F e.
Assume HpFun: function_on p (ordsucc n) R.
Assume Hp0: apply_fun p Empty = 0.
Assume HpStep: ∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x).
Assume Hpn1: apply_fun p n = 1.
We will prove Rle (weighted_sum x n e) (apply_fun eps A).
Set epsA to be the term apply_fun eps A.
We prove the intermediate claim HepsA: epsA R Rlt 0 epsA.
An exact proof term for the current goal is (Heps A HA).
We prove the intermediate claim HepsAR: epsA R.
An exact proof term for the current goal is (andEL (epsA R) (Rlt 0 epsA) HepsA).
We prove the intermediate claim HepsAS: SNo epsA.
An exact proof term for the current goal is (real_SNo epsA HepsAR).
We prove the intermediate claim HeFun: function_on e n F.
An exact proof term for the current goal is (andEL (function_on e n F) (∀y : set, y F∃x0 : set, x0 n apply_fun e x0 = y (∀x' : set, x' napply_fun e x' = yx' = x0)) Hbij).
We prove the intermediate claim HekF: ∀k : set, k napply_fun e k F.
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HeFun k Hk).
We prove the intermediate claim HekP: ∀k : set, k napply_fun e k P.
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HFsubP (apply_fun e k) (HekF k Hk)).
We prove the intermediate claim HvalR: ∀k : set, k napply_fun (apply_fun e k) x R.
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HPval_in_R (apply_fun e k) x (HekP k Hk) HxX).
We prove the intermediate claim HvalNN: ∀k : set, k nRle 0 (apply_fun (apply_fun e k) x).
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HPval_nonneg (apply_fun e k) x (HekP k Hk) HxX).
We prove the intermediate claim HcoefR: ∀f : set, f Papply_fun coef_of f R.
Let f be given.
Assume HfP: f P.
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of f) (Hcoef_pos f HfP)).
We prove the intermediate claim HtermLe: ∀k : set, k nRle (mul_SNo (apply_fun coef_of (apply_fun e k)) (apply_fun (apply_fun e k) x)) (mul_SNo epsA (apply_fun (apply_fun e k) x)).
Let k be given.
Assume Hk: k n.
Set fk to be the term apply_fun e k.
Set vk to be the term apply_fun fk x.
Apply (xm (vk = 0)) to the current goal.
Assume Hv0: vk = 0.
We prove the intermediate claim HfkP: fk P.
An exact proof term for the current goal is (HekP k Hk).
We prove the intermediate claim HcoefS: SNo (apply_fun coef_of fk).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of fk) (HcoefR fk HfkP)).
We prove the intermediate claim HvkR: vk R.
An exact proof term for the current goal is (HvalR k Hk).
rewrite the current goal using Hv0 (from left to right).
rewrite the current goal using (mul_SNo_zeroR (apply_fun coef_of fk) HcoefS) (from left to right).
rewrite the current goal using (mul_SNo_zeroR epsA HepsAS) (from left to right).
Apply (RleI 0 0 real_0 real_0) to the current goal.
An exact proof term for the current goal is (not_Rlt_refl 0 real_0).
Assume HvNe0: ¬ (vk = 0).
We prove the intermediate claim HfkP: fk P.
An exact proof term for the current goal is (HekP k Hk).
We prove the intermediate claim HvNe: apply_fun fk x 0.
An exact proof term for the current goal is HvNe0.
We prove the intermediate claim HcoefLe: Rle (apply_fun coef_of fk) epsA.
An exact proof term for the current goal is (Hcoef_le_on_point fk A x HfkP HA HxX HxA HvNe).
We prove the intermediate claim HvkNN: Rle 0 vk.
An exact proof term for the current goal is (HvalNN k Hk).
We prove the intermediate claim HcoefLeS: apply_fun coef_of fk epsA.
An exact proof term for the current goal is (SNoLe_of_Rle (apply_fun coef_of fk) epsA HcoefLe).
We prove the intermediate claim HvkNNS: 0 vk.
An exact proof term for the current goal is (SNoLe_of_Rle 0 vk HvkNN).
We prove the intermediate claim HcoefS: SNo (apply_fun coef_of fk).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of fk) (HcoefR fk HfkP)).
We prove the intermediate claim HvkS: SNo vk.
An exact proof term for the current goal is (real_SNo vk (HvalR k Hk)).
We prove the intermediate claim HmulLeS: mul_SNo vk (apply_fun coef_of fk) mul_SNo vk epsA.
An exact proof term for the current goal is (nonneg_mul_SNo_Le vk (apply_fun coef_of fk) epsA HvkS HvkNNS HcoefS HepsAS HcoefLeS).
We prove the intermediate claim Hcomm1: mul_SNo (apply_fun coef_of fk) vk = mul_SNo vk (apply_fun coef_of fk).
An exact proof term for the current goal is (mul_SNo_com (apply_fun coef_of fk) vk HcoefS HvkS).
We prove the intermediate claim Hcomm2: mul_SNo epsA vk = mul_SNo vk epsA.
An exact proof term for the current goal is (mul_SNo_com epsA vk HepsAS HvkS).
rewrite the current goal using Hcomm1 (from left to right).
rewrite the current goal using Hcomm2 (from left to right).
An exact proof term for the current goal is (Rle_of_SNoLe (mul_SNo vk (apply_fun coef_of fk)) (mul_SNo vk epsA) (real_mul_SNo vk (HvalR k Hk) (apply_fun coef_of fk) (HcoefR fk HfkP)) (real_mul_SNo vk (HvalR k Hk) epsA HepsAR) HmulLeS).
We prove the intermediate claim Hmain: Rle (weighted_sum x n e) (mul_SNo epsA (apply_fun p n)).
We prove the intermediate claim HnNat: nat_p n.
An exact proof term for the current goal is (omega_nat_p n HnO).
Set Pbound to be the term λm : setm ordsucc nRle (weighted_sum x m e) (mul_SNo epsA (apply_fun p m)).
We prove the intermediate claim Hind: ∀m : set, nat_p mPbound m.
Apply nat_ind to the current goal.
We will prove Pbound 0.
Assume H0In: 0 ordsucc n.
rewrite the current goal using (weighted_sum_0 x e) (from left to right).
We prove the intermediate claim H0E: 0 = Empty.
Use reflexivity.
rewrite the current goal using H0E (from left to right).
rewrite the current goal using Hp0 (from left to right).
rewrite the current goal using (mul_SNo_zeroR epsA HepsAS) (from left to right).
Apply (RleI 0 0 real_0 real_0) to the current goal.
An exact proof term for the current goal is (not_Rlt_refl 0 real_0).
Let m be given.
Assume HmNat: nat_p m.
Assume IHm: Pbound m.
We will prove Pbound (ordsucc m).
Assume HSmIn: ordsucc m ordsucc n.
We prove the intermediate claim HnNat2: nat_p n.
An exact proof term for the current goal is (omega_nat_p n HnO).
We prove the intermediate claim HnOrd: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat2).
We prove the intermediate claim HnTS: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd).
We prove the intermediate claim HsuccTS: TransSet (ordsucc n).
An exact proof term for the current goal is (TransSet_ordsucc n HnTS).
We prove the intermediate claim HsubSm: ordsucc m ordsucc n.
An exact proof term for the current goal is (HsuccTS (ordsucc m) HSmIn).
We prove the intermediate claim HmInSuccN: m ordsucc n.
An exact proof term for the current goal is (HsubSm m (ordsuccI2 m)).
We prove the intermediate claim HmCase: m n m = n.
An exact proof term for the current goal is (ordsuccE n m HmInSuccN).
Apply (HmCase (Rle (weighted_sum x (ordsucc m) e) (mul_SNo epsA (apply_fun p (ordsucc m))))) to the current goal.
Assume HmInN: m n.
We prove the intermediate claim HI: Rle (weighted_sum x m e) (mul_SNo epsA (apply_fun p m)).
An exact proof term for the current goal is (IHm HmInSuccN).
We prove the intermediate claim Hterm: Rle (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)) (mul_SNo epsA (apply_fun (apply_fun e m) x)).
An exact proof term for the current goal is (HtermLe m HmInN).
We prove the intermediate claim HwsEq: weighted_sum x (ordsucc m) e = weighted_step x e m (weighted_sum x m e).
An exact proof term for the current goal is (weighted_sum_S x e m HmNat).
rewrite the current goal using HwsEq (from left to right).
We prove the intermediate claim HstepDef: weighted_step x e m (weighted_sum x m e) = add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
rewrite the current goal using (HpStep m HmInN) (from left to right).
Set pm to be the term apply_fun p m.
Set vm to be the term apply_fun (apply_fun e m) x.
Set term to be the term mul_SNo (apply_fun coef_of (apply_fun e m)) vm.
Set rhs2 to be the term mul_SNo epsA vm.
Set rhs1 to be the term mul_SNo epsA pm.
We prove the intermediate claim HwsR: weighted_sum x m e R.
An exact proof term for the current goal is (RleE_left (weighted_sum x m e) (mul_SNo epsA pm) HI).
We prove the intermediate claim Hrhs1R: rhs1 R.
An exact proof term for the current goal is (RleE_right (weighted_sum x m e) (mul_SNo epsA pm) HI).
We prove the intermediate claim HtermR: term R.
An exact proof term for the current goal is (RleE_left term rhs2 Hterm).
We prove the intermediate claim Hrhs2R: rhs2 R.
An exact proof term for the current goal is (RleE_right term rhs2 Hterm).
We prove the intermediate claim HpmR: pm R.
An exact proof term for the current goal is (HpFun m HmInSuccN).
We prove the intermediate claim HvmR: vm R.
An exact proof term for the current goal is (HvalR m HmInN).
We prove the intermediate claim HpmS: SNo pm.
An exact proof term for the current goal is (real_SNo pm HpmR).
We prove the intermediate claim HvmS: SNo vm.
An exact proof term for the current goal is (real_SNo vm HvmR).
We prove the intermediate claim Hdist: mul_SNo epsA (add_SNo pm vm) = add_SNo rhs1 rhs2.
An exact proof term for the current goal is (mul_SNo_distrL epsA pm vm HepsAS HpmS HvmS).
rewrite the current goal using Hdist (from left to right).
We prove the intermediate claim Hstep2: Rle (add_SNo (weighted_sum x m e) term) (add_SNo (weighted_sum x m e) rhs2).
An exact proof term for the current goal is (Rle_add_SNo_2 (weighted_sum x m e) term rhs2 HwsR HtermR Hrhs2R Hterm).
We prove the intermediate claim Hstep1: Rle (add_SNo (weighted_sum x m e) rhs2) (add_SNo rhs1 rhs2).
An exact proof term for the current goal is (Rle_add_SNo_1 (weighted_sum x m e) rhs1 rhs2 HwsR Hrhs1R Hrhs2R HI).
An exact proof term for the current goal is (Rle_tra (add_SNo (weighted_sum x m e) term) (add_SNo (weighted_sum x m e) rhs2) (add_SNo rhs1 rhs2) Hstep2 Hstep1).
Assume HmEqN: m = n.
We prove the intermediate claim HnNat3: nat_p n.
An exact proof term for the current goal is (omega_nat_p n HnO).
We prove the intermediate claim HnotInSelf: ∀k : set, nat_p k¬ (k k).
Let k be given.
Assume HkNat: nat_p k.
Set Q to be the term λt : set¬ (t t).
We prove the intermediate claim HQ0: Q 0.
Assume H0In: 0 0.
An exact proof term for the current goal is (EmptyE 0 H0In).
We prove the intermediate claim HQS: ∀t : set, nat_p tQ tQ (ordsucc t).
Let t be given.
Assume HtNat: nat_p t.
Assume IHt: Q t.
We will prove Q (ordsucc t).
Assume HtIn: ordsucc t ordsucc t.
We prove the intermediate claim Hcase: ordsucc t t ordsucc t = t.
An exact proof term for the current goal is (ordsuccE t (ordsucc t) HtIn).
Apply (Hcase False) to the current goal.
Assume HInT: ordsucc t t.
We prove the intermediate claim HtOrd: ordinal t.
An exact proof term for the current goal is (nat_p_ordinal t HtNat).
We prove the intermediate claim HtTS: TransSet t.
An exact proof term for the current goal is (ordinal_TransSet t HtOrd).
We prove the intermediate claim Hsub: ordsucc t t.
An exact proof term for the current goal is (HtTS (ordsucc t) HInT).
An exact proof term for the current goal is (IHt (Hsub t (ordsuccI2 t))).
Assume Heq: ordsucc t = t.
We prove the intermediate claim Htt: t t.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 t).
An exact proof term for the current goal is (IHt Htt).
An exact proof term for the current goal is (nat_ind Q HQ0 HQS k HkNat).
We prove the intermediate claim HnNotIn: ¬ (n n).
An exact proof term for the current goal is (HnotInSelf n HnNat3).
We prove the intermediate claim HsuccInSucc: ordsucc n ordsucc n.
rewrite the current goal using HmEqN (from right to left) at position 1.
An exact proof term for the current goal is HSmIn.
We prove the intermediate claim HcaseN: ordsucc n n ordsucc n = n.
An exact proof term for the current goal is (ordsuccE n (ordsucc n) HsuccInSucc).
We prove the intermediate claim HnInN: n n.
Apply (HcaseN (n n)) to the current goal.
Assume HsuccIn: ordsucc n n.
We prove the intermediate claim HnOrd: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat3).
We prove the intermediate claim HnTS2: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd).
We prove the intermediate claim Hsub: ordsucc n n.
An exact proof term for the current goal is (HnTS2 (ordsucc n) HsuccIn).
An exact proof term for the current goal is (Hsub n (ordsuccI2 n)).
Assume Heq: ordsucc n = n.
rewrite the current goal using Heq (from right to left) at position 2.
An exact proof term for the current goal is (ordsuccI2 n).
Apply FalseE to the current goal.
An exact proof term for the current goal is (HnNotIn HnInN).
We prove the intermediate claim HnIn: n ordsucc n.
An exact proof term for the current goal is (ordsuccI2 n).
An exact proof term for the current goal is (Hind n HnNat HnIn).
We prove the intermediate claim HrhsEq: mul_SNo epsA (apply_fun p n) = epsA.
rewrite the current goal using Hpn1 (from left to right).
An exact proof term for the current goal is (mul_SNo_oneR epsA HepsAS).
rewrite the current goal using HrhsEq (from right to left).
An exact proof term for the current goal is Hmain.
We prove the intermediate claim weighted_sum_bijection_zero_outside_real: ∀x n0 F0 e0 n F e : set, x Xn0 ωfinite FF0 FF PF0 P(∀f : set, f F0apply_fun f x R)(∀f : set, f F0apply_fun coef_of f R)(∀f : set, f F¬ (f F0)apply_fun f x = 0)bijection n0 F0 e0n ωbijection n F eweighted_sum x n0 e0 = weighted_sum x n e.
Let x, n0, F0, e0, n, F and e be given.
Assume HxX: x X.
Assume Hn0O: n0 ω.
Assume HFfin: finite F.
Assume HF0subF: F0 F.
Assume HFsubP: F P.
Assume HF0subP: F0 P.
Assume HvalR0: ∀f : set, f F0apply_fun f x R.
Assume HcoefR0: ∀f : set, f F0apply_fun coef_of f R.
Assume HzeroOut: ∀f : set, f F¬ (f F0)apply_fun f x = 0.
Assume Hbij0: bijection n0 F0 e0.
Assume HnO: n ω.
Assume Hbij: bijection n F e.
Set D to be the term F F0.
We prove the intermediate claim HDsubF: D F.
An exact proof term for the current goal is (setminus_Subq F F0).
We prove the intermediate claim HDfin: finite D.
An exact proof term for the current goal is (Subq_finite F HFfin D HDsubF).
We prove the intermediate claim HDsubP: D P.
An exact proof term for the current goal is (Subq_tra D F P HDsubF HFsubP).
We prove the intermediate claim HDnotF0: ∀f : set, f D¬ (f F0).
Let f be given.
Assume HfD: f D.
An exact proof term for the current goal is (setminusE2 F F0 f HfD).
We prove the intermediate claim HzeroD: ∀f : set, f Dapply_fun f x = 0.
Let f be given.
Assume HfD: f D.
We prove the intermediate claim HfF: f F.
An exact proof term for the current goal is (setminusE1 F F0 f HfD).
An exact proof term for the current goal is (HzeroOut f HfF (HDnotF0 f HfD)).
We prove the intermediate claim HeqFD: F = F0 D.
Apply set_ext to the current goal.
Let u be given.
Assume HuF: u F.
Apply (xm (u F0)) to the current goal.
Assume HuF0: u F0.
An exact proof term for the current goal is (binunionI1 F0 D u HuF0).
Assume HnotF0: ¬ (u F0).
We prove the intermediate claim HuD: u D.
An exact proof term for the current goal is (setminusI F F0 u HuF HnotF0).
An exact proof term for the current goal is (binunionI2 F0 D u HuD).
Let u be given.
Assume HuU: u F0 D.
Apply (binunionE F0 D u HuU) to the current goal.
Assume HuF0: u F0.
An exact proof term for the current goal is (HF0subF u HuF0).
Assume HuD: u D.
An exact proof term for the current goal is (HDsubF u HuD).
We prove the intermediate claim HbijU: bijection n (F0 D) e.
rewrite the current goal using HeqFD (from right to left).
An exact proof term for the current goal is Hbij.
Set Pdrop to be the term λT : set∀nT eT : set, T P(∀f : set, f T¬ (f F0))(∀f : set, f Tapply_fun f x = 0)nT ωbijection nT (F0 T) eTweighted_sum x n0 e0 = weighted_sum x nT eT.
We prove the intermediate claim HP0: Pdrop Empty.
Let nT and eT be given.
Assume HsubP: Empty P.
Assume HnotF0T: ∀f : set, f Empty¬ (f F0).
Assume HzeroT: ∀f : set, f Emptyapply_fun f x = 0.
Assume HnTO: nT ω.
Assume HbijT: bijection nT (F0 Empty) eT.
We prove the intermediate claim HeqU: (F0 Empty) = F0.
Apply set_ext to the current goal.
Let u be given.
Assume HuU: u F0 Empty.
Apply (binunionE F0 Empty u HuU) to the current goal.
Assume HuF0: u F0.
An exact proof term for the current goal is HuF0.
Assume HuE: u Empty.
Apply FalseE to the current goal.
An exact proof term for the current goal is (EmptyE u HuE).
Let u be given.
Assume HuF0: u F0.
An exact proof term for the current goal is (binunionI1 F0 Empty u HuF0).
We prove the intermediate claim HbijF0: bijection nT F0 eT.
rewrite the current goal using HeqU (from right to left).
An exact proof term for the current goal is HbijT.
We prove the intermediate claim Heq_n0F0: equip n0 F0.
An exact proof term for the current goal is (equip_of_bijection n0 F0 e0 Hbij0).
We prove the intermediate claim Heq_nTF0: equip nT F0.
An exact proof term for the current goal is (equip_of_bijection nT F0 eT HbijF0).
We prove the intermediate claim Heq_n0nT: equip n0 nT.
An exact proof term for the current goal is (equip_tra n0 F0 nT Heq_n0F0 (equip_sym nT F0 Heq_nTF0)).
We prove the intermediate claim Hn0Eq: n0 = nT.
An exact proof term for the current goal is (equip_omega_eq n0 nT Hn0O HnTO Heq_n0nT).
We prove the intermediate claim HbijF0n0: bijection n0 F0 eT.
rewrite the current goal using Hn0Eq (from left to right).
An exact proof term for the current goal is HbijF0.
rewrite the current goal using Hn0Eq (from right to left).
An exact proof term for the current goal is (weighted_sum_bijection_indep_real x n0 F0 e0 eT HxX Hn0O HF0subP HvalR0 HcoefR0 Hbij0 HbijF0n0).
We prove the intermediate claim HPS: ∀T y : set, finite Ty TPdrop TPdrop (T {y}).
Let T and y be given.
Assume HTfin: finite T.
Assume HyNot: y T.
Assume IH: Pdrop T.
We will prove Pdrop (T {y}).
Let nT and eT be given.
Assume HsubP: (T {y}) P.
Assume HnotF0Ty: ∀f : set, f (T {y})¬ (f F0).
Assume HzeroTy: ∀f : set, f (T {y})apply_fun f x = 0.
Assume HnTO: nT ω.
Assume HbijTy: bijection nT (F0 (T {y})) eT.
We prove the intermediate claim HyP: y P.
An exact proof term for the current goal is (HsubP y (binunionI2 T {y} y (SingI y))).
We prove the intermediate claim HyNotF0: ¬ (y F0).
An exact proof term for the current goal is (HnotF0Ty y (binunionI2 T {y} y (SingI y))).
We prove the intermediate claim Hy0: apply_fun y x = 0.
An exact proof term for the current goal is (HzeroTy y (binunionI2 T {y} y (SingI y))).
We prove the intermediate claim HnTnat: nat_p nT.
An exact proof term for the current goal is (omega_nat_p nT HnTO).
We prove the intermediate claim Hcase: nT = 0 ∃m : set, nat_p m nT = ordsucc m.
An exact proof term for the current goal is (nat_inv nT HnTnat).
Apply (Hcase (weighted_sum x n0 e0 = weighted_sum x nT eT)) to the current goal.
Assume Hn0: nT = 0.
Apply FalseE to the current goal.
We prove the intermediate claim HyInCod: y (F0 (T {y})).
An exact proof term for the current goal is (binunionI2 F0 (T {y}) y (binunionI2 T {y} y (SingI y))).
We prove the intermediate claim Hbij0Ty: bijection 0 (F0 (T {y})) eT.
rewrite the current goal using Hn0 (from right to left).
An exact proof term for the current goal is HbijTy.
We prove the intermediate claim Hexk: ∃k : set, k 0 apply_fun eT k = y.
An exact proof term for the current goal is (bijection_surj 0 (F0 (T {y})) eT y Hbij0Ty HyInCod).
Apply Hexk to the current goal.
Let k be given.
Assume Hkpair.
We prove the intermediate claim Hk0: k 0.
An exact proof term for the current goal is (andEL (k 0) (apply_fun eT k = y) Hkpair).
An exact proof term for the current goal is (EmptyE k Hk0).
Assume Hexm: ∃m : set, nat_p m nT = ordsucc m.
Apply Hexm to the current goal.
Let m be given.
Assume Hmconj: nat_p m nT = ordsucc m.
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (andEL (nat_p m) (nT = ordsucc m) Hmconj).
We prove the intermediate claim HnTEq: nT = ordsucc m.
An exact proof term for the current goal is (andER (nat_p m) (nT = ordsucc m) Hmconj).
We prove the intermediate claim HmO: m ω.
An exact proof term for the current goal is (nat_p_omega m HmNat).
We prove the intermediate claim HFsubP_all: (F0 (T {y})) P.
Let u be given.
Assume Hu: u (F0 (T {y})).
Apply (binunionE F0 (T {y}) u Hu) to the current goal.
Assume HuF0: u F0.
An exact proof term for the current goal is (HF0subP u HuF0).
Assume HuT: u (T {y}).
An exact proof term for the current goal is (HsubP u HuT).
We prove the intermediate claim HvalR_all: ∀g : set, g (F0 (T {y}))apply_fun g x R.
Let g be given.
Assume HgU: g (F0 (T {y})).
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HFsubP_all g HgU).
An exact proof term for the current goal is (HPval_in_R g x HgP HxX).
We prove the intermediate claim HcoefR_all: ∀g : set, g (F0 (T {y}))apply_fun coef_of g R.
Let g be given.
Assume HgU: g (F0 (T {y})).
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HFsubP_all g HgU).
We prove the intermediate claim Hpos: Rlt 0 (apply_fun coef_of g).
An exact proof term for the current goal is (Hcoef_pos g HgP).
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of g) Hpos).
We prove the intermediate claim HbijS: bijection (ordsucc m) (F0 (T {y})) eT.
rewrite the current goal using HnTEq (from right to left).
An exact proof term for the current goal is HbijTy.
We prove the intermediate claim HyInU: y (F0 (T {y})).
An exact proof term for the current goal is (binunionI2 F0 (T {y}) y (binunionI2 T {y} y (SingI y))).
We prove the intermediate claim Hrem: ∃e' : set, bijection m ((F0 (T {y})) {y}) e' weighted_sum x (ordsucc m) eT = weighted_sum x m e'.
An exact proof term for the current goal is (weighted_sum_bijection_remove_one_zero_real x m (F0 (T {y})) eT y HxX HmO HFsubP_all HvalR_all HcoefR_all HbijS HyInU Hy0).
Apply Hrem to the current goal.
Let e' be given.
Assume He'pack.
We prove the intermediate claim HbijE': bijection m ((F0 (T {y})) {y}) e'.
An exact proof term for the current goal is (andEL (bijection m ((F0 (T {y})) {y}) e') (weighted_sum x (ordsucc m) eT = weighted_sum x m e') He'pack).
We prove the intermediate claim HwsEq: weighted_sum x (ordsucc m) eT = weighted_sum x m e'.
An exact proof term for the current goal is (andER (bijection m ((F0 (T {y})) {y}) e') (weighted_sum x (ordsucc m) eT = weighted_sum x m e') He'pack).
We prove the intermediate claim HeqRem: ((F0 (T {y})) {y}) = (F0 T).
Apply set_ext to the current goal.
Let u be given.
Assume Hu: u ((F0 (T {y})) {y}).
We prove the intermediate claim HuPair: u (F0 (T {y})) u {y}.
An exact proof term for the current goal is (setminusE (F0 (T {y})) {y} u Hu).
We prove the intermediate claim HuIn: u (F0 (T {y})).
An exact proof term for the current goal is (andEL (u (F0 (T {y}))) (u {y}) HuPair).
We prove the intermediate claim HuNotY: u {y}.
An exact proof term for the current goal is (andER (u (F0 (T {y}))) (u {y}) HuPair).
Apply (binunionE F0 (T {y}) u HuIn) to the current goal.
Assume HuF0: u F0.
An exact proof term for the current goal is (binunionI1 F0 T u HuF0).
Assume HuT: u (T {y}).
Apply (binunionE T {y} u HuT) to the current goal.
Assume HuT0: u T.
An exact proof term for the current goal is (binunionI2 F0 T u HuT0).
Assume HuY: u {y}.
Apply FalseE to the current goal.
An exact proof term for the current goal is (HuNotY HuY).
Let u be given.
Assume Hu: u (F0 T).
We will prove u ((F0 (T {y})) {y}).
We prove the intermediate claim HuIn: u (F0 (T {y})).
Apply (binunionE F0 T u Hu) to the current goal.
Assume HuF0: u F0.
An exact proof term for the current goal is (binunionI1 F0 (T {y}) u HuF0).
Assume HuT0: u T.
An exact proof term for the current goal is (binunionI2 F0 (T {y}) u (binunionI1 T {y} u HuT0)).
We prove the intermediate claim HuNotY: u {y}.
Assume HuY: u {y}.
We prove the intermediate claim HuEq: u = y.
An exact proof term for the current goal is (SingE y u HuY).
We will prove False.
We prove the intermediate claim HyU: y (F0 T).
rewrite the current goal using HuEq (from right to left).
An exact proof term for the current goal is Hu.
Apply (binunionE F0 T y HyU) to the current goal.
Assume HyF0: y F0.
Apply HyNotF0 to the current goal.
An exact proof term for the current goal is HyF0.
Assume HyT: y T.
Apply HyNot to the current goal.
An exact proof term for the current goal is HyT.
An exact proof term for the current goal is (setminusI (F0 (T {y})) {y} u HuIn HuNotY).
We prove the intermediate claim HbijSmall: bijection m (F0 T) e'.
rewrite the current goal using HeqRem (from right to left).
An exact proof term for the current goal is HbijE'.
We prove the intermediate claim HTsubP: T P.
Let u be given.
Assume HuT: u T.
We prove the intermediate claim HuTU: u (T {y}).
An exact proof term for the current goal is (binunionI1 T {y} u HuT).
An exact proof term for the current goal is (HsubP u HuTU).
We prove the intermediate claim HTnotF0: ∀f : set, f T¬ (f F0).
Let f be given.
Assume HfT: f T.
We prove the intermediate claim HfTU: f (T {y}).
An exact proof term for the current goal is (binunionI1 T {y} f HfT).
An exact proof term for the current goal is (HnotF0Ty f HfTU).
We prove the intermediate claim HzeroT: ∀f : set, f Tapply_fun f x = 0.
Let f be given.
Assume HfT: f T.
We prove the intermediate claim HfTU: f (T {y}).
An exact proof term for the current goal is (binunionI1 T {y} f HfT).
An exact proof term for the current goal is (HzeroTy f HfTU).
We prove the intermediate claim Hrec: weighted_sum x n0 e0 = weighted_sum x m e'.
An exact proof term for the current goal is (IH m e' HTsubP HTnotF0 HzeroT HmO HbijSmall).
rewrite the current goal using HnTEq (from left to right).
rewrite the current goal using HwsEq (from left to right).
An exact proof term for the current goal is Hrec.
We prove the intermediate claim HdropD: Pdrop D.
An exact proof term for the current goal is (finite_ind Pdrop HP0 HPS D HDfin).
An exact proof term for the current goal is (HdropD n e HDsubP HDnotF0 HzeroD HnO HbijU).
We prove the intermediate claim weighted_sum_pos_on_point: ∀x F n e p : set, x Xfinite FF P(∀f : set, f Papply_fun f x 0f F)n ωbijection n F efunction_on p (ordsucc n) Rapply_fun p Empty = 0(∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))apply_fun p n = 1Rlt 0 (weighted_sum x n e).
Let x, F, n, e and p be given.
Assume HxX: x X.
Assume HFfin: finite F.
Assume HFsubP: F P.
Assume Hsupp: ∀f : set, f Papply_fun f x 0f F.
Assume HnO: n ω.
Assume Hbij: bijection n F e.
Assume HpFun: function_on p (ordsucc n) R.
Assume Hp0: apply_fun p Empty = 0.
Assume HpStep: ∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x).
Assume Hpn1: apply_fun p n = 1.
We will prove Rlt 0 (weighted_sum x n e).
We prove the intermediate claim HnNat: nat_p n.
An exact proof term for the current goal is (omega_nat_p n HnO).
We prove the intermediate claim HeFun: function_on e n F.
An exact proof term for the current goal is (andEL (function_on e n F) (∀y : set, y F∃x0 : set, x0 n apply_fun e x0 = y (∀x' : set, x' napply_fun e x' = yx' = x0)) Hbij).
We prove the intermediate claim HekF: ∀k : set, k napply_fun e k F.
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HeFun k Hk).
We prove the intermediate claim HekP: ∀k : set, k napply_fun e k P.
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HFsubP (apply_fun e k) (HekF k Hk)).
We prove the intermediate claim HvalR: ∀k : set, k napply_fun (apply_fun e k) x R.
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HPval_in_R (apply_fun e k) x (HekP k Hk) HxX).
We prove the intermediate claim HvalNN: ∀k : set, k nRle 0 (apply_fun (apply_fun e k) x).
Let k be given.
Assume Hk: k n.
An exact proof term for the current goal is (HPval_nonneg (apply_fun e k) x (HekP k Hk) HxX).
Apply (xm (∃k : set, k n apply_fun (apply_fun e k) x 0)) to the current goal.
Assume Hex: ∃k : set, k n apply_fun (apply_fun e k) x 0.
Apply Hex to the current goal.
Let k0 be given.
Assume Hk0: k0 n apply_fun (apply_fun e k0) x 0.
Set fk0 to be the term apply_fun e k0.
Set vk0 to be the term apply_fun fk0 x.
We prove the intermediate claim Hk0In: k0 n.
An exact proof term for the current goal is (andEL (k0 n) (apply_fun (apply_fun e k0) x 0) Hk0).
We prove the intermediate claim Hvk0Ne0: vk0 0.
An exact proof term for the current goal is (andER (k0 n) (apply_fun (apply_fun e k0) x 0) Hk0).
We prove the intermediate claim Hvk0R: vk0 R.
An exact proof term for the current goal is (HvalR k0 Hk0In).
We prove the intermediate claim Hvk0NN: Rle 0 vk0.
An exact proof term for the current goal is (HvalNN k0 Hk0In).
We prove the intermediate claim Hvk0pos: Rlt 0 vk0.
We prove the intermediate claim H0R: 0 R.
An exact proof term for the current goal is real_0.
We prove the intermediate claim H0S: SNo 0.
An exact proof term for the current goal is SNo_0.
We prove the intermediate claim Hvk0S: SNo vk0.
An exact proof term for the current goal is (real_SNo vk0 Hvk0R).
We prove the intermediate claim Hnlt: ¬ (Rlt vk0 0).
An exact proof term for the current goal is (RleE_nlt 0 vk0 Hvk0NN).
Apply (SNoLt_trichotomy_or_impred vk0 0 Hvk0S H0S (Rlt 0 vk0)) to the current goal.
Assume Hvlt0: vk0 < 0.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hnlt (RltI vk0 0 Hvk0R H0R Hvlt0)).
Assume Hveq0: vk0 = 0.
Apply FalseE to the current goal.
An exact proof term for the current goal is (Hvk0Ne0 Hveq0).
Assume H0ltv: 0 < vk0.
An exact proof term for the current goal is (RltI 0 vk0 H0R Hvk0R H0ltv).
We prove the intermediate claim Hfk0P: fk0 P.
An exact proof term for the current goal is (HekP k0 Hk0In).
We prove the intermediate claim HcoefPos: Rlt 0 (apply_fun coef_of fk0).
An exact proof term for the current goal is (Hcoef_pos fk0 Hfk0P).
We prove the intermediate claim HcoefR: apply_fun coef_of fk0 R.
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of fk0) HcoefPos).
We prove the intermediate claim HcoefS: SNo (apply_fun coef_of fk0).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of fk0) HcoefR).
We prove the intermediate claim Hvk0S2: SNo vk0.
An exact proof term for the current goal is (real_SNo vk0 Hvk0R).
We prove the intermediate claim HcoefLt0S: 0 < apply_fun coef_of fk0.
An exact proof term for the current goal is (RltE_lt 0 (apply_fun coef_of fk0) HcoefPos).
We prove the intermediate claim Hvk0Lt0S: 0 < vk0.
An exact proof term for the current goal is (RltE_lt 0 vk0 Hvk0pos).
We prove the intermediate claim HtermLt0S: 0 < mul_SNo (apply_fun coef_of fk0) vk0.
An exact proof term for the current goal is (mul_SNo_pos_pos (apply_fun coef_of fk0) vk0 HcoefS Hvk0S2 HcoefLt0S Hvk0Lt0S).
We prove the intermediate claim HtermR: mul_SNo (apply_fun coef_of fk0) vk0 R.
An exact proof term for the current goal is (real_mul_SNo (apply_fun coef_of fk0) HcoefR vk0 Hvk0R).
We prove the intermediate claim HtermPos: Rlt 0 (mul_SNo (apply_fun coef_of fk0) vk0).
An exact proof term for the current goal is (RltI 0 (mul_SNo (apply_fun coef_of fk0) vk0) real_0 HtermR HtermLt0S).
We prove the intermediate claim HtermLe: Rle (mul_SNo (apply_fun coef_of fk0) vk0) (weighted_sum x n e).
Set term0 to be the term mul_SNo (apply_fun coef_of fk0) vk0.
We prove the intermediate claim HwsRall: ∀m : set, m ordsucc nweighted_sum x m e R.
Set Pws to be the term λm : setm ordsucc nweighted_sum x m e R.
We prove the intermediate claim Hind: ∀m : set, nat_p mPws m.
Apply nat_ind to the current goal.
We will prove Pws 0.
Assume H0In: 0 ordsucc n.
rewrite the current goal using (weighted_sum_0 x e) (from left to right).
An exact proof term for the current goal is real_0.
Let m be given.
Assume HmNat: nat_p m.
Assume IHm: Pws m.
We will prove Pws (ordsucc m).
Assume HSmIn: ordsucc m ordsucc n.
We prove the intermediate claim HnOrd: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd).
We prove the intermediate claim HmInN: m n.
We prove the intermediate claim HmCase: ordsucc m n ordsucc m = n.
An exact proof term for the current goal is (ordsuccE n (ordsucc m) HSmIn).
Apply (HmCase (m n)) to the current goal.
Assume HSmInN: ordsucc m n.
We prove the intermediate claim Hsub: ordsucc m n.
An exact proof term for the current goal is (HnTS (ordsucc m) HSmInN).
An exact proof term for the current goal is (Hsub m (ordsuccI2 m)).
Assume Heq: ordsucc m = n.
rewrite the current goal using Heq (from right to left).
An exact proof term for the current goal is (ordsuccI2 m).
We prove the intermediate claim HmInSuccN: m ordsucc n.
An exact proof term for the current goal is ((ordsuccI1 n) m HmInN).
We prove the intermediate claim HaccR: weighted_sum x m e R.
An exact proof term for the current goal is (IHm HmInSuccN).
We prove the intermediate claim HkP: apply_fun e m P.
An exact proof term for the current goal is (HekP m HmInN).
We prove the intermediate claim HvalmR: apply_fun (apply_fun e m) x R.
An exact proof term for the current goal is (HvalR m HmInN).
We prove the intermediate claim HcoefPosm: Rlt 0 (apply_fun coef_of (apply_fun e m)).
An exact proof term for the current goal is (Hcoef_pos (apply_fun e m) HkP).
We prove the intermediate claim HcoefmR: apply_fun coef_of (apply_fun e m) R.
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of (apply_fun e m)) HcoefPosm).
We prove the intermediate claim HtermRm: mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x) R.
An exact proof term for the current goal is (real_mul_SNo (apply_fun coef_of (apply_fun e m)) HcoefmR (apply_fun (apply_fun e m) x) HvalmR).
We prove the intermediate claim HprimS: nat_primrec 0 (weighted_step x e) (ordsucc m) = weighted_step x e m (nat_primrec 0 (weighted_step x e) m).
An exact proof term for the current goal is (nat_primrec_S 0 (weighted_step x e) m HmNat).
rewrite the current goal using HprimS (from left to right).
We prove the intermediate claim HdefM: nat_primrec 0 (weighted_step x e) m = weighted_sum x m e.
Use reflexivity.
rewrite the current goal using HdefM (from left to right).
We prove the intermediate claim HstepDef: weighted_step x e m (weighted_sum x m e) = add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
An exact proof term for the current goal is (real_add_SNo (weighted_sum x m e) HaccR (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)) HtermRm).
Let m be given.
Assume HmInSuccN: m ordsucc n.
We prove the intermediate claim HsuccNO: ordsucc n ω.
An exact proof term for the current goal is (omega_ordsucc n HnO).
We prove the intermediate claim HsuccNsubO: ordsucc n ω.
An exact proof term for the current goal is (omega_TransSet (ordsucc n) HsuccNO).
We prove the intermediate claim HmO: m ω.
An exact proof term for the current goal is (HsuccNsubO m HmInSuccN).
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (omega_nat_p m HmO).
An exact proof term for the current goal is (Hind m HmNat HmInSuccN).
We prove the intermediate claim HwsNNall: ∀m : set, m ordsucc n0 weighted_sum x m e.
Set Pnn to be the term λm : setm ordsucc n0 weighted_sum x m e.
We prove the intermediate claim Hind: ∀m : set, nat_p mPnn m.
Apply nat_ind to the current goal.
We will prove Pnn 0.
Assume H0In: 0 ordsucc n.
rewrite the current goal using (weighted_sum_0 x e) (from left to right).
An exact proof term for the current goal is (SNoLe_ref 0).
Let m be given.
Assume HmNat: nat_p m.
Assume IHm: Pnn m.
We will prove Pnn (ordsucc m).
Assume HSmIn: ordsucc m ordsucc n.
We prove the intermediate claim HnOrd: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd).
We prove the intermediate claim HmInN: m n.
We prove the intermediate claim HmCase: ordsucc m n ordsucc m = n.
An exact proof term for the current goal is (ordsuccE n (ordsucc m) HSmIn).
Apply (HmCase (m n)) to the current goal.
Assume HSmInN: ordsucc m n.
We prove the intermediate claim Hsub: ordsucc m n.
An exact proof term for the current goal is (HnTS (ordsucc m) HSmInN).
An exact proof term for the current goal is (Hsub m (ordsuccI2 m)).
Assume Heq: ordsucc m = n.
rewrite the current goal using Heq (from right to left).
An exact proof term for the current goal is (ordsuccI2 m).
We prove the intermediate claim HmInSuccN: m ordsucc n.
An exact proof term for the current goal is ((ordsuccI1 n) m HmInN).
We prove the intermediate claim HaccNN: 0 weighted_sum x m e.
An exact proof term for the current goal is (IHm HmInSuccN).
We prove the intermediate claim HaccR: weighted_sum x m e R.
An exact proof term for the current goal is (HwsRall m HmInSuccN).
We prove the intermediate claim HaccS: SNo (weighted_sum x m e).
An exact proof term for the current goal is (real_SNo (weighted_sum x m e) HaccR).
We prove the intermediate claim HkP: apply_fun e m P.
An exact proof term for the current goal is (HekP m HmInN).
We prove the intermediate claim HvalmR: apply_fun (apply_fun e m) x R.
An exact proof term for the current goal is (HvalR m HmInN).
We prove the intermediate claim HvalmNNR: Rle 0 (apply_fun (apply_fun e m) x).
An exact proof term for the current goal is (HvalNN m HmInN).
We prove the intermediate claim HvalmS: SNo (apply_fun (apply_fun e m) x).
An exact proof term for the current goal is (real_SNo (apply_fun (apply_fun e m) x) HvalmR).
We prove the intermediate claim HvalmNN: 0 apply_fun (apply_fun e m) x.
An exact proof term for the current goal is (SNoLe_of_Rle 0 (apply_fun (apply_fun e m) x) HvalmNNR).
We prove the intermediate claim HcoefPosm: Rlt 0 (apply_fun coef_of (apply_fun e m)).
An exact proof term for the current goal is (Hcoef_pos (apply_fun e m) HkP).
We prove the intermediate claim HcoefmR: apply_fun coef_of (apply_fun e m) R.
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of (apply_fun e m)) HcoefPosm).
We prove the intermediate claim HcoefmS: SNo (apply_fun coef_of (apply_fun e m)).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of (apply_fun e m)) HcoefmR).
We prove the intermediate claim HcoefmNNR: Rle 0 (apply_fun coef_of (apply_fun e m)).
An exact proof term for the current goal is (Rlt_implies_Rle 0 (apply_fun coef_of (apply_fun e m)) HcoefPosm).
We prove the intermediate claim HcoefmNN: 0 apply_fun coef_of (apply_fun e m).
An exact proof term for the current goal is (SNoLe_of_Rle 0 (apply_fun coef_of (apply_fun e m)) HcoefmNNR).
We prove the intermediate claim HtermNN: 0 mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x).
An exact proof term for the current goal is (mul_SNo_nonneg_nonneg (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x) HcoefmS HvalmS HcoefmNN HvalmNN).
We prove the intermediate claim HtermRm: mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x) R.
An exact proof term for the current goal is (real_mul_SNo (apply_fun coef_of (apply_fun e m)) HcoefmR (apply_fun (apply_fun e m) x) HvalmR).
We prove the intermediate claim HtermSm: SNo (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
An exact proof term for the current goal is (real_SNo (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)) HtermRm).
We prove the intermediate claim HstepLe: weighted_sum x m e add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
An exact proof term for the current goal is (SNoLe_add_nonneg_right (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)) HaccS HtermSm HtermNN).
We prove the intermediate claim HsumNN: 0 add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
An exact proof term for the current goal is (SNoLe_tra 0 (weighted_sum x m e) (add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x))) SNo_0 HaccS (SNo_add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)) HaccS HtermSm) HaccNN HstepLe).
We prove the intermediate claim HprimS: nat_primrec 0 (weighted_step x e) (ordsucc m) = weighted_step x e m (nat_primrec 0 (weighted_step x e) m).
An exact proof term for the current goal is (nat_primrec_S 0 (weighted_step x e) m HmNat).
rewrite the current goal using HprimS (from left to right).
We prove the intermediate claim HdefM: nat_primrec 0 (weighted_step x e) m = weighted_sum x m e.
Use reflexivity.
rewrite the current goal using HdefM (from left to right).
We prove the intermediate claim HstepDef: weighted_step x e m (weighted_sum x m e) = add_SNo (weighted_sum x m e) (mul_SNo (apply_fun coef_of (apply_fun e m)) (apply_fun (apply_fun e m) x)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
An exact proof term for the current goal is HsumNN.
Let m be given.
Assume HmInSuccN: m ordsucc n.
We prove the intermediate claim HsuccNO: ordsucc n ω.
An exact proof term for the current goal is (omega_ordsucc n HnO).
We prove the intermediate claim HsuccNsubO: ordsucc n ω.
An exact proof term for the current goal is (omega_TransSet (ordsucc n) HsuccNO).
We prove the intermediate claim HmO: m ω.
An exact proof term for the current goal is (HsuccNsubO m HmInSuccN).
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (omega_nat_p m HmO).
An exact proof term for the current goal is (Hind m HmNat HmInSuccN).
We prove the intermediate claim HnIn: n ordsucc n.
An exact proof term for the current goal is (ordsuccI2 n).
We prove the intermediate claim HwsRn: weighted_sum x n e R.
An exact proof term for the current goal is (HwsRall n HnIn).
We prove the intermediate claim HleS: term0 weighted_sum x n e.
Set Q to be the term λt : sett ordsucc nk0 tterm0 weighted_sum x t e.
We prove the intermediate claim HQ0: Q 0.
Assume H0In: 0 ordsucc n.
Assume Hk0In0: k0 0.
Apply FalseE to the current goal.
An exact proof term for the current goal is (EmptyE k0 Hk0In0).
We prove the intermediate claim HQS: ∀t : set, nat_p tQ tQ (ordsucc t).
Let t be given.
Assume HtNat: nat_p t.
Assume IHt: Q t.
We will prove Q (ordsucc t).
Assume HStIn: ordsucc t ordsucc n.
Assume Hk0InSt: k0 ordsucc t.
We prove the intermediate claim Hcases: k0 t k0 = t.
An exact proof term for the current goal is (ordsuccE t k0 Hk0InSt).
Apply (Hcases (term0 weighted_sum x (ordsucc t) e)) to the current goal.
Assume Hk0InT: k0 t.
We prove the intermediate claim HtInSuccN: t ordsucc n.
We prove the intermediate claim HnOrd2: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS2: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd2).
We prove the intermediate claim HsuccTS2: TransSet (ordsucc n).
An exact proof term for the current goal is (TransSet_ordsucc n HnTS2).
We prove the intermediate claim HsubSt: ordsucc t ordsucc n.
An exact proof term for the current goal is (HsuccTS2 (ordsucc t) HStIn).
An exact proof term for the current goal is (HsubSt t (ordsuccI2 t)).
We prove the intermediate claim HleT: term0 weighted_sum x t e.
An exact proof term for the current goal is (IHt HtInSuccN Hk0InT).
We prove the intermediate claim HtR: weighted_sum x t e R.
An exact proof term for the current goal is (HwsRall t HtInSuccN).
We prove the intermediate claim HtS: SNo (weighted_sum x t e).
An exact proof term for the current goal is (real_SNo (weighted_sum x t e) HtR).
We prove the intermediate claim Hmono: weighted_sum x t e weighted_sum x (ordsucc t) e.
We prove the intermediate claim HtInN: t n.
We prove the intermediate claim HnOrd2: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS2: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd2).
We prove the intermediate claim HtCase: ordsucc t n ordsucc t = n.
An exact proof term for the current goal is (ordsuccE n (ordsucc t) HStIn).
Apply (HtCase (t n)) to the current goal.
Assume HStInN: ordsucc t n.
We prove the intermediate claim Hsub: ordsucc t n.
An exact proof term for the current goal is (HnTS2 (ordsucc t) HStInN).
An exact proof term for the current goal is (Hsub t (ordsuccI2 t)).
Assume Heq: ordsucc t = n.
rewrite the current goal using Heq (from right to left).
An exact proof term for the current goal is (ordsuccI2 t).
We prove the intermediate claim HcoefPosm: Rlt 0 (apply_fun coef_of (apply_fun e t)).
An exact proof term for the current goal is (Hcoef_pos (apply_fun e t) (HekP t HtInN)).
We prove the intermediate claim HcoefmR: apply_fun coef_of (apply_fun e t) R.
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of (apply_fun e t)) HcoefPosm).
We prove the intermediate claim HcoefmS: SNo (apply_fun coef_of (apply_fun e t)).
An exact proof term for the current goal is (real_SNo (apply_fun coef_of (apply_fun e t)) HcoefmR).
We prove the intermediate claim HvR: apply_fun (apply_fun e t) x R.
An exact proof term for the current goal is (HvalR t HtInN).
We prove the intermediate claim HvS: SNo (apply_fun (apply_fun e t) x).
An exact proof term for the current goal is (real_SNo (apply_fun (apply_fun e t) x) HvR).
We prove the intermediate claim HvNNR: Rle 0 (apply_fun (apply_fun e t) x).
An exact proof term for the current goal is (HvalNN t HtInN).
We prove the intermediate claim HvNN: 0 apply_fun (apply_fun e t) x.
An exact proof term for the current goal is (SNoLe_of_Rle 0 (apply_fun (apply_fun e t) x) HvNNR).
We prove the intermediate claim HcoefNNR: Rle 0 (apply_fun coef_of (apply_fun e t)).
An exact proof term for the current goal is (Rlt_implies_Rle 0 (apply_fun coef_of (apply_fun e t)) HcoefPosm).
We prove the intermediate claim HcoefNN: 0 apply_fun coef_of (apply_fun e t).
An exact proof term for the current goal is (SNoLe_of_Rle 0 (apply_fun coef_of (apply_fun e t)) HcoefNNR).
We prove the intermediate claim HttermNN: 0 mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x).
An exact proof term for the current goal is (mul_SNo_nonneg_nonneg (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x) HcoefmS HvS HcoefNN HvNN).
We prove the intermediate claim HttermR: mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x) R.
An exact proof term for the current goal is (real_mul_SNo (apply_fun coef_of (apply_fun e t)) HcoefmR (apply_fun (apply_fun e t) x) HvR).
We prove the intermediate claim HttermS: SNo (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)).
An exact proof term for the current goal is (real_SNo (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)) HttermR).
We prove the intermediate claim HwsEq: weighted_sum x (ordsucc t) e = weighted_step x e t (weighted_sum x t e).
An exact proof term for the current goal is (weighted_sum_S x e t HtNat).
rewrite the current goal using HwsEq (from left to right).
We prove the intermediate claim HstepDef: weighted_step x e t (weighted_sum x t e) = add_SNo (weighted_sum x t e) (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
An exact proof term for the current goal is (SNoLe_add_nonneg_right (weighted_sum x t e) (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)) HtS HttermS HttermNN).
An exact proof term for the current goal is (SNoLe_tra term0 (weighted_sum x t e) (weighted_sum x (ordsucc t) e) (real_SNo term0 HtermR) HtS (real_SNo (weighted_sum x (ordsucc t) e) (HwsRall (ordsucc t) HStIn)) HleT Hmono).
Assume Hk0EqT: k0 = t.
We prove the intermediate claim HtInSuccN: t ordsucc n.
We prove the intermediate claim HnOrd2: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS2: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd2).
We prove the intermediate claim HsuccTS2: TransSet (ordsucc n).
An exact proof term for the current goal is (TransSet_ordsucc n HnTS2).
We prove the intermediate claim HsubSt: ordsucc t ordsucc n.
An exact proof term for the current goal is (HsuccTS2 (ordsucc t) HStIn).
An exact proof term for the current goal is (HsubSt t (ordsuccI2 t)).
We prove the intermediate claim HwsNN: 0 weighted_sum x t e.
An exact proof term for the current goal is (HwsNNall t HtInSuccN).
We prove the intermediate claim HwsR: weighted_sum x t e R.
An exact proof term for the current goal is (HwsRall t HtInSuccN).
We prove the intermediate claim HwsS: SNo (weighted_sum x t e).
An exact proof term for the current goal is (real_SNo (weighted_sum x t e) HwsR).
We prove the intermediate claim HtInN: t n.
We prove the intermediate claim HnOrd2: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS2: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd2).
We prove the intermediate claim HtCase: ordsucc t n ordsucc t = n.
An exact proof term for the current goal is (ordsuccE n (ordsucc t) HStIn).
Apply (HtCase (t n)) to the current goal.
Assume HStInN: ordsucc t n.
We prove the intermediate claim Hsub: ordsucc t n.
An exact proof term for the current goal is (HnTS2 (ordsucc t) HStInN).
An exact proof term for the current goal is (Hsub t (ordsuccI2 t)).
Assume Heq: ordsucc t = n.
rewrite the current goal using Heq (from right to left).
An exact proof term for the current goal is (ordsuccI2 t).
We prove the intermediate claim HttermEq: mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x) = term0.
rewrite the current goal using Hk0EqT (from right to left).
Use reflexivity.
We prove the intermediate claim HttermR: mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x) R.
We prove the intermediate claim HcoefPosm: Rlt 0 (apply_fun coef_of (apply_fun e t)).
An exact proof term for the current goal is (Hcoef_pos (apply_fun e t) (HekP t HtInN)).
We prove the intermediate claim HcoefmR: apply_fun coef_of (apply_fun e t) R.
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of (apply_fun e t)) HcoefPosm).
We prove the intermediate claim HvR: apply_fun (apply_fun e t) x R.
An exact proof term for the current goal is (HvalR t HtInN).
An exact proof term for the current goal is (real_mul_SNo (apply_fun coef_of (apply_fun e t)) HcoefmR (apply_fun (apply_fun e t) x) HvR).
We prove the intermediate claim HttermS: SNo (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)).
An exact proof term for the current goal is (real_SNo (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)) HttermR).
We prove the intermediate claim HwsEq: weighted_sum x (ordsucc t) e = weighted_step x e t (weighted_sum x t e).
An exact proof term for the current goal is (weighted_sum_S x e t HtNat).
rewrite the current goal using HwsEq (from left to right).
We prove the intermediate claim HstepDef: weighted_step x e t (weighted_sum x t e) = add_SNo (weighted_sum x t e) (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
We prove the intermediate claim HaddCom: add_SNo (weighted_sum x t e) (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)) = add_SNo (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)) (weighted_sum x t e).
An exact proof term for the current goal is (add_SNo_com (weighted_sum x t e) (mul_SNo (apply_fun coef_of (apply_fun e t)) (apply_fun (apply_fun e t) x)) HwsS HttermS).
rewrite the current goal using HaddCom (from left to right).
rewrite the current goal using HttermEq (from left to right).
An exact proof term for the current goal is (SNoLe_add_nonneg_right term0 (weighted_sum x t e) (real_SNo term0 HtermR) HwsS HwsNN).
An exact proof term for the current goal is (nat_ind Q HQ0 HQS n HnNat HnIn Hk0In).
An exact proof term for the current goal is (Rle_of_SNoLe term0 (weighted_sum x n e) HtermR HwsRn HleS).
An exact proof term for the current goal is (Rlt_Rle_tra 0 (mul_SNo (apply_fun coef_of fk0) vk0) (weighted_sum x n e) HtermPos HtermLe).
Assume Hnone: ¬ (∃k : set, k n apply_fun (apply_fun e k) x 0).
We will prove Rlt 0 (weighted_sum x n e).
Apply FalseE to the current goal.
We prove the intermediate claim Hval0: ∀k : set, k napply_fun (apply_fun e k) x = 0.
Let k be given.
Assume Hk: k n.
Apply (xm (apply_fun (apply_fun e k) x = 0)) to the current goal.
An exact proof term for the current goal is (λH ⇒ H).
Assume Hneq0: ¬ (apply_fun (apply_fun e k) x = 0).
Apply FalseE to the current goal.
Apply Hnone to the current goal.
We use k to witness the existential quantifier.
Apply andI to the current goal.
An exact proof term for the current goal is Hk.
Assume Heq: apply_fun (apply_fun e k) x = 0.
An exact proof term for the current goal is (Hneq0 Heq).
We prove the intermediate claim Hp0n: apply_fun p n = 0.
Set Pp to be the term λm : setm ordsucc napply_fun p m = 0.
We prove the intermediate claim Hind: ∀m : set, nat_p mPp m.
Apply nat_ind to the current goal.
We will prove Pp 0.
Assume H0In: 0 ordsucc n.
We prove the intermediate claim H0E: 0 = Empty.
Use reflexivity.
rewrite the current goal using H0E (from left to right).
An exact proof term for the current goal is Hp0.
Let m be given.
Assume HmNat: nat_p m.
Assume IHm: Pp m.
We will prove Pp (ordsucc m).
Assume HSmIn: ordsucc m ordsucc n.
We prove the intermediate claim HnOrd: ordinal n.
An exact proof term for the current goal is (nat_p_ordinal n HnNat).
We prove the intermediate claim HnTS: TransSet n.
An exact proof term for the current goal is (ordinal_TransSet n HnOrd).
We prove the intermediate claim HsuccTS: TransSet (ordsucc n).
An exact proof term for the current goal is (TransSet_ordsucc n HnTS).
We prove the intermediate claim HsubSm: ordsucc m ordsucc n.
An exact proof term for the current goal is (HsuccTS (ordsucc m) HSmIn).
We prove the intermediate claim HmInSuccN: m ordsucc n.
An exact proof term for the current goal is (HsubSm m (ordsuccI2 m)).
We prove the intermediate claim HmInN: m n.
We prove the intermediate claim Hcase: ordsucc m n ordsucc m = n.
An exact proof term for the current goal is (ordsuccE n (ordsucc m) HSmIn).
Apply (Hcase (m n)) to the current goal.
Assume HIn: ordsucc m n.
We prove the intermediate claim Hsub: ordsucc m n.
An exact proof term for the current goal is (HnTS (ordsucc m) HIn).
An exact proof term for the current goal is (Hsub m (ordsuccI2 m)).
Assume Heq: ordsucc m = n.
rewrite the current goal using Heq (from right to left).
An exact proof term for the current goal is (ordsuccI2 m).
rewrite the current goal using (HpStep m HmInN) (from left to right).
We prove the intermediate claim HpM: apply_fun p m = 0.
An exact proof term for the current goal is (IHm HmInSuccN).
rewrite the current goal using HpM (from left to right).
rewrite the current goal using (Hval0 m HmInN) (from left to right).
rewrite the current goal using (add_SNo_0R 0 SNo_0) (from left to right).
Use reflexivity.
We prove the intermediate claim HnIn: n ordsucc n.
An exact proof term for the current goal is (ordsuccI2 n).
An exact proof term for the current goal is (Hind n HnNat HnIn).
We prove the intermediate claim H10: 1 = 0.
rewrite the current goal using Hpn1 (from right to left).
An exact proof term for the current goal is Hp0n.
An exact proof term for the current goal is (neq_1_0 H10).
Set Pval to be the term λx : setλy : set∃F : set, finite F F P (∀f : set, f Papply_fun f x 0f F) ∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 y = weighted_sum x n e.
Set w_of to be the term λx : setEps_i (λy : setPval x y).
Set f to be the term graph X w_of.
We prove the intermediate claim Hw_of: ∀x : set, x XPval x (w_of x).
Let x be given.
Assume HxX: x X.
Set Q to be the term λy : setPval x y.
We prove the intermediate claim Hex: ∃y : set, Q y.
We prove the intermediate claim HexPack: ∃F : set, finite F F P (∀f : set, f Papply_fun f x 0f F) ∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1.
An exact proof term for the current goal is (partition_of_unity_family_pointwise_finite_sum X Tx U P HP x HxX).
Apply HexPack to the current goal.
Let F be given.
Assume HFpack.
We prove the intermediate claim HABC: (finite F F P) (∀f : set, f Papply_fun f x 0f F).
An exact proof term for the current goal is (andEL ((finite F F P) (∀f : set, f Papply_fun f x 0f F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1) HFpack).
We prove the intermediate claim Hexn: ∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1.
An exact proof term for the current goal is (andER ((finite F F P) (∀f : set, f Papply_fun f x 0f F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1) HFpack).
We prove the intermediate claim HfinSub: finite F F P.
An exact proof term for the current goal is (andEL (finite F F P) (∀f : set, f Papply_fun f x 0f F) HABC).
We prove the intermediate claim Hsupp: ∀f : set, f Papply_fun f x 0f F.
An exact proof term for the current goal is (andER (finite F F P) (∀f : set, f Papply_fun f x 0f F) HABC).
We prove the intermediate claim HFfin: finite F.
An exact proof term for the current goal is (andEL (finite F) (F P) HfinSub).
We prove the intermediate claim HFsubP: F P.
An exact proof term for the current goal is (andER (finite F) (F P) HfinSub).
Apply Hexn to the current goal.
Let n be given.
Assume Hnpack.
We prove the intermediate claim HnO: n ω.
An exact proof term for the current goal is (andEL (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1) Hnpack).
We prove the intermediate claim Hexe: ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1.
An exact proof term for the current goal is (andER (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1) Hnpack).
Apply Hexe to the current goal.
Let e be given.
Assume Hepack.
We prove the intermediate claim Hbij: bijection n F e.
An exact proof term for the current goal is (andEL (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1) Hepack).
We prove the intermediate claim Hexp: ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1.
An exact proof term for the current goal is (andER (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1) Hepack).
Apply Hexp to the current goal.
Let p be given.
Assume Hppack.
We prove the intermediate claim Hp12: (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)).
An exact proof term for the current goal is (andEL ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) (apply_fun p n = 1) Hppack).
We prove the intermediate claim Hpn1: apply_fun p n = 1.
An exact proof term for the current goal is (andER ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) (apply_fun p n = 1) Hppack).
We prove the intermediate claim Hp10: function_on p (ordsucc n) R apply_fun p Empty = 0.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) Hp12).
We prove the intermediate claim HpStep: ∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x).
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) Hp12).
We prove the intermediate claim HpFun: function_on p (ordsucc n) R.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R) (apply_fun p Empty = 0) Hp10).
We prove the intermediate claim Hp0: apply_fun p Empty = 0.
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R) (apply_fun p Empty = 0) Hp10).
We use (weighted_sum x n e) to witness the existential quantifier.
We will prove Q (weighted_sum x n e).
We prove the intermediate claim HQ: Q (weighted_sum x n e) = Pval x (weighted_sum x n e).
Use reflexivity.
rewrite the current goal using HQ (from left to right).
We prove the intermediate claim HPdef: Pval x (weighted_sum x n e) = (∃F0 : set, finite F0 F0 P (∀f : set, f Papply_fun f x 0f F0) ∃n0 : set, n0 ω ∃e0 : set, bijection n0 F0 e0 ∃p0 : set, function_on p0 (ordsucc n0) R apply_fun p0 Empty = 0 (∀k : set, k n0apply_fun p0 (ordsucc k) = add_SNo (apply_fun p0 k) (apply_fun (apply_fun e0 k) x)) apply_fun p0 n0 = 1 weighted_sum x n e = weighted_sum x n0 e0).
Use reflexivity.
rewrite the current goal using HPdef (from left to right).
We use F 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 HFfin.
An exact proof term for the current goal is HFsubP.
An exact proof term for the current goal is Hsupp.
We use n to witness the existential quantifier.
Apply andI to the current goal.
An exact proof term for the current goal is HnO.
We use e to witness the existential quantifier.
Apply andI to the current goal.
An exact proof term for the current goal is Hbij.
We use p to witness the existential quantifier.
Apply andI to the current goal.
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 HpFun.
An exact proof term for the current goal is Hp0.
An exact proof term for the current goal is HpStep.
An exact proof term for the current goal is Hpn1.
Use reflexivity.
Apply Hex to the current goal.
Let y be given.
Assume Hy: Q y.
An exact proof term for the current goal is (Eps_i_ax Q y Hy).
We prove the intermediate claim HfPos: ∀x : set, x XRlt 0 (apply_fun f x).
Let x be given.
Assume HxX: x X.
We prove the intermediate claim Hfdef: f = graph X w_of.
Use reflexivity.
We prove the intermediate claim Hfxeq: apply_fun f x = w_of x.
rewrite the current goal using Hfdef (from left to right).
An exact proof term for the current goal is (apply_fun_graph X w_of x HxX).
rewrite the current goal using Hfxeq (from left to right).
We prove the intermediate claim Hw: Pval x (w_of x).
An exact proof term for the current goal is (Hw_of x HxX).
Apply Hw to the current goal.
Let F be given.
Assume HFpack.
We prove the intermediate claim HABC: (finite F F P) (∀f : set, f Papply_fun f x 0f F).
An exact proof term for the current goal is (andEL ((finite F F P) (∀f : set, f Papply_fun f x 0f F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) HFpack).
We prove the intermediate claim Hexn: ∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER ((finite F F P) (∀f : set, f Papply_fun f x 0f F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) HFpack).
We prove the intermediate claim HfinSub: finite F F P.
An exact proof term for the current goal is (andEL (finite F F P) (∀f : set, f Papply_fun f x 0f F) HABC).
We prove the intermediate claim Hsupp: ∀f : set, f Papply_fun f x 0f F.
An exact proof term for the current goal is (andER (finite F F P) (∀f : set, f Papply_fun f x 0f F) HABC).
We prove the intermediate claim HFfin: finite F.
An exact proof term for the current goal is (andEL (finite F) (F P) HfinSub).
We prove the intermediate claim HFsubP: F P.
An exact proof term for the current goal is (andER (finite F) (F P) HfinSub).
Apply Hexn to the current goal.
Let n be given.
Assume Hnpack.
We prove the intermediate claim HnO: n ω.
An exact proof term for the current goal is (andEL (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hnpack).
We prove the intermediate claim Hexe: ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hnpack).
Apply Hexe to the current goal.
Let e be given.
Assume Hepack.
We prove the intermediate claim Hbij: bijection n F e.
An exact proof term for the current goal is (andEL (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hepack).
We prove the intermediate claim Hexp: ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hepack).
Apply Hexp to the current goal.
Let p be given.
Assume Hppack.
We prove the intermediate claim HppackL: ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) apply_fun p n = 1.
An exact proof term for the current goal is (andEL (((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) apply_fun p n = 1) (w_of x = weighted_sum x n e) Hppack).
We prove the intermediate claim HyEq: w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER (((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) apply_fun p n = 1) (w_of x = weighted_sum x n e) Hppack).
We prove the intermediate claim HppackL2: (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)).
An exact proof term for the current goal is (andEL ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) (apply_fun p n = 1) HppackL).
We prove the intermediate claim Hpn1: apply_fun p n = 1.
An exact proof term for the current goal is (andER ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) (apply_fun p n = 1) HppackL).
We prove the intermediate claim HpAB: function_on p (ordsucc n) R apply_fun p Empty = 0.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) HppackL2).
We prove the intermediate claim HpStep: ∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x).
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) HppackL2).
We prove the intermediate claim HpFun: function_on p (ordsucc n) R.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R) (apply_fun p Empty = 0) HpAB).
We prove the intermediate claim Hp0: apply_fun p Empty = 0.
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R) (apply_fun p Empty = 0) HpAB).
We prove the intermediate claim Hpos: Rlt 0 (weighted_sum x n e).
An exact proof term for the current goal is (weighted_sum_pos_on_point x F n e p HxX HFfin HFsubP Hsupp HnO Hbij HpFun Hp0 HpStep Hpn1).
rewrite the current goal using HyEq (from left to right).
An exact proof term for the current goal is Hpos.
We prove the intermediate claim HfLe: ∀c x : set, c Cx cRle (apply_fun f x) (apply_fun eps c).
Let c and x be given.
Assume HcC: c C.
Assume Hxc: x c.
We prove the intermediate claim HxX: x X.
We prove the intermediate claim HcPow: c 𝒫 X.
An exact proof term for the current goal is (HCsubPow c HcC).
We prove the intermediate claim HcSubX: c X.
An exact proof term for the current goal is (PowerE X c HcPow).
An exact proof term for the current goal is (HcSubX x Hxc).
We prove the intermediate claim Hfdef: f = graph X w_of.
Use reflexivity.
We prove the intermediate claim Hfxeq: apply_fun f x = w_of x.
rewrite the current goal using Hfdef (from left to right).
An exact proof term for the current goal is (apply_fun_graph X w_of x HxX).
rewrite the current goal using Hfxeq (from left to right).
We prove the intermediate claim Hw: Pval x (w_of x).
An exact proof term for the current goal is (Hw_of x HxX).
Apply Hw to the current goal.
Let F be given.
Assume HFpack.
We prove the intermediate claim HABC: (finite F F P) (∀f : set, f Papply_fun f x 0f F).
An exact proof term for the current goal is (andEL ((finite F F P) (∀f : set, f Papply_fun f x 0f F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) HFpack).
We prove the intermediate claim Hexn: ∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER ((finite F F P) (∀f : set, f Papply_fun f x 0f F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) HFpack).
We prove the intermediate claim HfinSub: finite F F P.
An exact proof term for the current goal is (andEL (finite F F P) (∀f : set, f Papply_fun f x 0f F) HABC).
We prove the intermediate claim Hsupp: ∀f : set, f Papply_fun f x 0f F.
An exact proof term for the current goal is (andER (finite F F P) (∀f : set, f Papply_fun f x 0f F) HABC).
We prove the intermediate claim HFfin: finite F.
An exact proof term for the current goal is (andEL (finite F) (F P) HfinSub).
We prove the intermediate claim HFsubP: F P.
An exact proof term for the current goal is (andER (finite F) (F P) HfinSub).
Apply Hexn to the current goal.
Let n be given.
Assume Hnpack.
We prove the intermediate claim HnO: n ω.
An exact proof term for the current goal is (andEL (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hnpack).
We prove the intermediate claim Hexe: ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hnpack).
Apply Hexe to the current goal.
Let e be given.
Assume Hepack.
We prove the intermediate claim Hbij: bijection n F e.
An exact proof term for the current goal is (andEL (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hepack).
We prove the intermediate claim Hexp: ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) apply_fun p n = 1 w_of x = weighted_sum x n e) Hepack).
Apply Hexp to the current goal.
Let p be given.
Assume Hppack.
We prove the intermediate claim HppackL: ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) apply_fun p n = 1.
An exact proof term for the current goal is (andEL (((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) apply_fun p n = 1) (w_of x = weighted_sum x n e) Hppack).
We prove the intermediate claim HyEq: w_of x = weighted_sum x n e.
An exact proof term for the current goal is (andER (((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) apply_fun p n = 1) (w_of x = weighted_sum x n e) Hppack).
We prove the intermediate claim HppackL2: (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)).
An exact proof term for the current goal is (andEL ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) (apply_fun p n = 1) HppackL).
We prove the intermediate claim Hpn1: apply_fun p n = 1.
An exact proof term for the current goal is (andER ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x))) (apply_fun p n = 1) HppackL).
We prove the intermediate claim HpAB: function_on p (ordsucc n) R apply_fun p Empty = 0.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) HppackL2).
We prove the intermediate claim HpStep: ∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x).
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) x)) HppackL2).
We prove the intermediate claim HpFun: function_on p (ordsucc n) R.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R) (apply_fun p Empty = 0) HpAB).
We prove the intermediate claim Hp0: apply_fun p Empty = 0.
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R) (apply_fun p Empty = 0) HpAB).
We prove the intermediate claim Hle: Rle (weighted_sum x n e) (apply_fun eps c).
An exact proof term for the current goal is (weighted_sum_le_eps_on_point c x F n e p HcC HxX Hxc HFfin HFsubP Hsupp HnO Hbij HpFun Hp0 HpStep Hpn1).
rewrite the current goal using HyEq (from left to right) at position 1.
An exact proof term for the current goal is Hle.
We use f to witness the existential quantifier.
Apply andI to the current goal.
Apply andI to the current goal.
We prove the intermediate claim Hf_cont: continuous_map X Tx R R_standard_topology f.
Set L0 to be the term ∀y0 : set, y0 Rcontinuous_map X Tx R R_standard_topology (const_fun X y0).
Set L1 to be the term ∀A : set, A Xcontinuous_map A (subspace_topology X Tx A) X Tx {(y,y)|yA}.
Set L3 to be the term ∀f0 A : set, A Xcontinuous_map X Tx R R_standard_topology f0continuous_map A (subspace_topology X Tx A) R R_standard_topology f0.
Set L4 to be the term (∀f0 Z0 : set, continuous_map X Tx R R_standard_topology f0Z0 R(∀x0 : set, x0 Xapply_fun f0 x0 Z0)continuous_map X Tx Z0 (subspace_topology R R_standard_topology Z0) f0) (∀f0 Z0 Tz0 : set, continuous_map X Tx R R_standard_topology f0R Z0topology_on Z0 Tz0R_standard_topology = subspace_topology Z0 Tz0 Rcontinuous_map X Tx Z0 Tz0 f0).
Set L5 to be the term ∀f0 : set, (∃UFam : set, UFam Tx UFam = X (∀U0 : set, U0 UFamcontinuous_map U0 (subspace_topology X Tx U0) R R_standard_topology f0))continuous_map X Tx R R_standard_topology f0.
We prove the intermediate claim HcrAll: ((((L0 L1) L2) L3) L4) L5.
We prove the intermediate claim Hlocal_rule: L5.
An exact proof term for the current goal is (andER ((((L0 L1) L2) L3) L4) L5 HcrAll).
We prove the intermediate claim Hlocal: ∃UFam : set, UFam Tx UFam = X (∀U0 : set, U0 UFamcontinuous_map U0 (subspace_topology X Tx U0) R R_standard_topology f).
Set pickN to be the term λx : setEps_i (λN : setN Tx x N ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff N Emptyff F0).
We prove the intermediate claim HpickN: ∀x : set, x XpickN x Tx x pickN x ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0.
Let x be given.
Assume HxX: x X.
We prove the intermediate claim Hex: ∃N : set, N Tx x N ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff N Emptyff F0.
An exact proof term for the current goal is (partition_of_unity_family_supports_locally_finite X Tx U P HP x HxX).
Apply Hex to the current goal.
Let N be given.
Assume HN: N Tx x N ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff N Emptyff F0.
An exact proof term for the current goal is (Eps_i_ax (λN0 : setN0 Tx x N0 ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff N0 Emptyff F0) N HN).
Set UFam to be the term Repl X (λx : setpickN x).
We use UFam to witness the existential quantifier.
Apply andI to the current goal.
Apply andI to the current goal.
Let N be given.
Assume HN: N UFam.
Apply (ReplE X (λx0 : setpickN x0) N HN) to the current goal.
Let x be given.
Assume Hx: x X N = pickN x.
We prove the intermediate claim HxX: x X.
An exact proof term for the current goal is (andEL (x X) (N = pickN x) Hx).
We prove the intermediate claim Heq: N = pickN x.
An exact proof term for the current goal is (andER (x X) (N = pickN x) Hx).
rewrite the current goal using Heq (from left to right).
We prove the intermediate claim HNprop: pickN x Tx x pickN x ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0.
An exact proof term for the current goal is (HpickN x HxX).
We prove the intermediate claim HNpair: pickN x Tx x pickN x.
An exact proof term for the current goal is (andEL (pickN x Tx x pickN x) (∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0) HNprop).
An exact proof term for the current goal is (andEL (pickN x Tx) (x pickN x) HNpair).
Apply set_ext to the current goal.
Let y be given.
Assume Hy: y UFam.
Apply (UnionE UFam y Hy) to the current goal.
Let N be given.
Assume HNy: y N N UFam.
We prove the intermediate claim HyN: y N.
An exact proof term for the current goal is (andEL (y N) (N UFam) HNy).
We prove the intermediate claim HNU: N UFam.
An exact proof term for the current goal is (andER (y N) (N UFam) HNy).
We prove the intermediate claim HNTx: N Tx.
Apply (ReplE X (λx0 : setpickN x0) N HNU) to the current goal.
Let x be given.
Assume Hx: x X N = pickN x.
We prove the intermediate claim HxX: x X.
An exact proof term for the current goal is (andEL (x X) (N = pickN x) Hx).
We prove the intermediate claim Heq: N = pickN x.
An exact proof term for the current goal is (andER (x X) (N = pickN x) Hx).
rewrite the current goal using Heq (from left to right).
We prove the intermediate claim HNprop: pickN x Tx x pickN x ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0.
An exact proof term for the current goal is (HpickN x HxX).
We prove the intermediate claim HNpair: pickN x Tx x pickN x.
An exact proof term for the current goal is (andEL (pickN x Tx x pickN x) (∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0) HNprop).
An exact proof term for the current goal is (andEL (pickN x Tx) (x pickN x) HNpair).
We prove the intermediate claim HsubPow: Tx 𝒫 X.
An exact proof term for the current goal is (topology_sub_Power X Tx HTx).
We prove the intermediate claim HNPow: N 𝒫 X.
An exact proof term for the current goal is (HsubPow N HNTx).
We prove the intermediate claim HNsubX: N X.
An exact proof term for the current goal is (PowerE X N HNPow).
An exact proof term for the current goal is (HNsubX y HyN).
Let y be given.
Assume HyX: y X.
Set N to be the term pickN y.
We prove the intermediate claim HNinU: N UFam.
An exact proof term for the current goal is (ReplI X (λx0 : setpickN x0) y HyX).
We prove the intermediate claim HNy: y N.
We prove the intermediate claim HNprop: pickN y Tx y pickN y ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN y Emptyff F0.
An exact proof term for the current goal is (HpickN y HyX).
We prove the intermediate claim HNpair: pickN y Tx y pickN y.
An exact proof term for the current goal is (andEL (pickN y Tx y pickN y) (∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN y Emptyff F0) HNprop).
An exact proof term for the current goal is (andER (pickN y Tx) (y pickN y) HNpair).
An exact proof term for the current goal is (UnionI UFam y N HNy HNinU).
Let U0 be given.
Assume HU0: U0 UFam.
Apply (ReplE X (λx0 : setpickN x0) U0 HU0) to the current goal.
Let x be given.
Assume Hx: x X U0 = pickN x.
We prove the intermediate claim HxX: x X.
An exact proof term for the current goal is (andEL (x X) (U0 = pickN x) Hx).
We prove the intermediate claim HU0eq: U0 = pickN x.
An exact proof term for the current goal is (andER (x X) (U0 = pickN x) Hx).
rewrite the current goal using HU0eq (from left to right).
We prove the intermediate claim HNprop: pickN x Tx x pickN x ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0.
An exact proof term for the current goal is (HpickN x HxX).
We prove the intermediate claim HexF0: ∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0.
An exact proof term for the current goal is (andER (pickN x Tx x pickN x) (∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0) HNprop).
Apply HexF0 to the current goal.
Let F0 be given.
Assume HF0: finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0.
We prove the intermediate claim HF0left: finite F0 F0 P.
An exact proof term for the current goal is (andEL (finite F0 F0 P) (∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0) HF0).
We prove the intermediate claim HF0hit: ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0.
An exact proof term for the current goal is (andER (finite F0 F0 P) (∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0) HF0).
We prove the intermediate claim HF0fin: finite F0.
An exact proof term for the current goal is (andEL (finite F0) (F0 P) HF0left).
We prove the intermediate claim HF0subP: F0 P.
An exact proof term for the current goal is (andER (finite F0) (F0 P) HF0left).
We prove the intermediate claim Hexne0: ∃n0 e0 : set, n0 ω bijection n0 F0 e0.
An exact proof term for the current goal is (finite_ex_bijection_from_omega F0 HF0fin).
We prove the intermediate claim HNsubX: pickN x X.
We prove the intermediate claim HsubPow: Tx 𝒫 X.
An exact proof term for the current goal is (topology_sub_Power X Tx HTx).
We prove the intermediate claim HNpair: pickN x Tx x pickN x.
An exact proof term for the current goal is (andEL (pickN x Tx x pickN x) (∃F0 : set, finite F0 F0 P ∀ff : set, ff Psupport_of X Tx ff pickN x Emptyff F0) HNprop).
We prove the intermediate claim HNtx: pickN x Tx.
An exact proof term for the current goal is (andEL (pickN x Tx) (x pickN x) HNpair).
We prove the intermediate claim HNPow: pickN x 𝒫 X.
An exact proof term for the current goal is (HsubPow (pickN x) HNtx).
An exact proof term for the current goal is (PowerE X (pickN x) HNPow).
We prove the intermediate claim Hzero_on_N: ∀y ff : set, y pickN xff P¬ (ff F0)apply_fun ff y = 0.
Let y and ff be given.
Assume HyN: y pickN x.
Assume HffP: ff P.
Assume HffNot: ¬ (ff F0).
Apply (xm (apply_fun ff y = 0)) to the current goal.
Assume H0: apply_fun ff y = 0.
An exact proof term for the current goal is H0.
Assume Hne0: ¬ (apply_fun ff y = 0).
Apply FalseE to the current goal.
We prove the intermediate claim HyX: y X.
An exact proof term for the current goal is (HNsubX y HyN).
We prove the intermediate claim HyNZ: apply_fun ff y 0.
An exact proof term for the current goal is Hne0.
Set A0 to be the term {zX|apply_fun ff z 0}.
We prove the intermediate claim HyA0: y A0.
Apply (SepI X (λz : setapply_fun ff z 0) y HyX) to the current goal.
An exact proof term for the current goal is HyNZ.
We prove the intermediate claim HA0subX: A0 X.
Let z be given.
Assume Hz: z A0.
An exact proof term for the current goal is (SepE1 X (λz0 : setapply_fun ff z0 0) z Hz).
We prove the intermediate claim HA0subcl: A0 closure_of X Tx A0.
An exact proof term for the current goal is (subset_of_closure X Tx A0 HTx HA0subX).
We prove the intermediate claim HySupp: y support_of X Tx ff.
We prove the intermediate claim HsuppDef: support_of X Tx ff = closure_of X Tx A0.
Use reflexivity.
rewrite the current goal using HsuppDef (from left to right).
An exact proof term for the current goal is (HA0subcl y HyA0).
We prove the intermediate claim Hhit: support_of X Tx ff pickN x Empty.
Assume Hcap0: support_of X Tx ff pickN x = Empty.
We prove the intermediate claim HyCap: y support_of X Tx ff pickN x.
An exact proof term for the current goal is (binintersectI (support_of X Tx ff) (pickN x) y HySupp HyN).
We prove the intermediate claim HyEmp: y Empty.
rewrite the current goal using Hcap0 (from right to left).
An exact proof term for the current goal is HyCap.
An exact proof term for the current goal is (EmptyE y HyEmp).
We prove the intermediate claim HffF0: ff F0.
An exact proof term for the current goal is (HF0hit ff HffP Hhit).
An exact proof term for the current goal is (HffNot HffF0).
We prove the intermediate claim Hnonzero_in_F0: ∀y ff : set, y pickN xff Papply_fun ff y 0ff F0.
Let y and ff be given.
Assume HyN: y pickN x.
Assume HffP: ff P.
Assume Hne0: apply_fun ff y 0.
Apply (xm (ff F0)) to the current goal.
Assume HffF0: ff F0.
An exact proof term for the current goal is HffF0.
Assume Hnot: ¬ (ff F0).
Apply FalseE to the current goal.
We prove the intermediate claim H0: apply_fun ff y = 0.
An exact proof term for the current goal is (Hzero_on_N y ff HyN HffP Hnot).
An exact proof term for the current goal is (Hne0 H0).
Apply Hexne0 to the current goal.
Let n0 be given.
Assume Hexe0: ∃e0 : set, n0 ω bijection n0 F0 e0.
Apply Hexe0 to the current goal.
Let e0 be given.
Assume Hne0: n0 ω bijection n0 F0 e0.
We prove the intermediate claim Hn0O: n0 ω.
An exact proof term for the current goal is (andEL (n0 ω) (bijection n0 F0 e0) Hne0).
We prove the intermediate claim Hbij0: bijection n0 F0 e0.
An exact proof term for the current goal is (andER (n0 ω) (bijection n0 F0 e0) Hne0).
Set g to be the term graph (pickN x) (λy0 : setweighted_sum y0 n0 e0).
We prove the intermediate claim Hgcont: continuous_map (pickN x) (subspace_topology X Tx (pickN x)) R R_standard_topology g.
Set A to be the term pickN x.
Set TA to be the term subspace_topology X Tx A.
We prove the intermediate claim HTA: topology_on A TA.
An exact proof term for the current goal is (subspace_topology_is_topology X Tx A HTx HNsubX).
We prove the intermediate claim Hn0Nat: nat_p n0.
An exact proof term for the current goal is (omega_nat_p n0 Hn0O).
Set Pw to be the term (λm : setm ordsucc n0continuous_map A TA R R_standard_topology (graph A (λy0 : setweighted_sum y0 m e0))).
We prove the intermediate claim Hbase: Pw 0.
Assume H0In: 0 ordsucc n0.
We prove the intermediate claim Hf0cont: continuous_map A TA R R_standard_topology (const_fun A 0).
An exact proof term for the current goal is (const_fun_continuous A TA R R_standard_topology 0 HTA R_standard_topology_is_topology_local real_0).
We prove the intermediate claim Hg0fun: function_on (graph A (λy0 : setweighted_sum y0 0 e0)) A R.
Let y0 be given.
Assume Hy0A: y0 A.
We will prove apply_fun (graph A (λy1 : setweighted_sum y1 0 e0)) y0 R.
We prove the intermediate claim Happ: apply_fun (graph A (λy1 : setweighted_sum y1 0 e0)) y0 = weighted_sum y0 0 e0.
An exact proof term for the current goal is (apply_fun_graph A (λy1 : setweighted_sum y1 0 e0) y0 Hy0A).
rewrite the current goal using Happ (from left to right).
We prove the intermediate claim Hws0: weighted_sum y0 0 e0 = 0.
An exact proof term for the current goal is (weighted_sum_0 y0 e0).
rewrite the current goal using Hws0 (from left to right) at position 1.
An exact proof term for the current goal is real_0.
We prove the intermediate claim Heq0: ∀y0 : set, y0 Aapply_fun (const_fun A 0) y0 = apply_fun (graph A (λy1 : setweighted_sum y1 0 e0)) y0.
Let y0 be given.
Assume Hy0A: y0 A.
We prove the intermediate claim Hconst: apply_fun (const_fun A 0) y0 = 0.
An exact proof term for the current goal is (const_fun_apply A 0 y0 Hy0A).
rewrite the current goal using Hconst (from left to right).
We prove the intermediate claim Happ: apply_fun (graph A (λy1 : setweighted_sum y1 0 e0)) y0 = weighted_sum y0 0 e0.
An exact proof term for the current goal is (apply_fun_graph A (λy1 : setweighted_sum y1 0 e0) y0 Hy0A).
rewrite the current goal using Happ (from left to right).
We prove the intermediate claim Hws0: weighted_sum y0 0 e0 = 0.
An exact proof term for the current goal is (weighted_sum_0 y0 e0).
rewrite the current goal using Hws0 (from left to right) at position 1.
Use reflexivity.
An exact proof term for the current goal is (continuous_map_congr_on A TA R R_standard_topology (const_fun A 0) (graph A (λy0 : setweighted_sum y0 0 e0)) Hf0cont Hg0fun Heq0).
We prove the intermediate claim Hstep: ∀n : set, nat_p nPw nPw (ordsucc n).
Let n be given.
Assume HnNat: nat_p n.
Assume IH: Pw n.
Assume HsuccIn: ordsucc n ordsucc n0.
We prove the intermediate claim Hsub: ordsucc n n0.
An exact proof term for the current goal is (nat_ordsucc_trans n0 Hn0Nat (ordsucc n) HsuccIn).
We prove the intermediate claim HnInN0: n n0.
An exact proof term for the current goal is (Hsub n (ordsuccI2 n)).
We prove the intermediate claim HnInSuccN0: n ordsucc n0.
An exact proof term for the current goal is (ordsuccI1 n0 n HnInN0).
We prove the intermediate claim Hwsncont: continuous_map A TA R R_standard_topology (graph A (λy0 : setweighted_sum y0 n e0)).
An exact proof term for the current goal is (IH HnInSuccN0).
We prove the intermediate claim HeFun: function_on e0 n0 F0.
Apply Hbij0 to the current goal.
Assume Hfun.
Assume _.
An exact proof term for the current goal is Hfun.
We prove the intermediate claim HfkF0: apply_fun e0 n F0.
An exact proof term for the current goal is (HeFun n HnInN0).
We prove the intermediate claim HfkP: apply_fun e0 n P.
An exact proof term for the current goal is (HF0subP (apply_fun e0 n) HfkF0).
We prove the intermediate claim HfkcontX: continuous_map X Tx R R_standard_topology (apply_fun e0 n).
An exact proof term for the current goal is (HPcont (apply_fun e0 n) HfkP).
We prove the intermediate claim HfkcontA: continuous_map A TA R R_standard_topology (apply_fun e0 n).
An exact proof term for the current goal is (continuous_on_subspace_rule X Tx R R_standard_topology (apply_fun e0 n) A HTx R_standard_topology_is_topology_local HNsubX HfkcontX).
We prove the intermediate claim Hcpos: Rlt 0 (apply_fun coef_of (apply_fun e0 n)).
An exact proof term for the current goal is (Hcoef_pos (apply_fun e0 n) HfkP).
We prove the intermediate claim HcR: apply_fun coef_of (apply_fun e0 n) R.
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of (apply_fun e0 n)) Hcpos).
We prove the intermediate claim Hconstc: continuous_map A TA R R_standard_topology (const_fun A (apply_fun coef_of (apply_fun e0 n))).
An exact proof term for the current goal is (const_fun_continuous A TA R R_standard_topology (apply_fun coef_of (apply_fun e0 n)) HTA R_standard_topology_is_topology_local HcR).
We prove the intermediate claim Htermcont: continuous_map A TA R R_standard_topology (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R).
An exact proof term for the current goal is (mul_two_continuous_R A TA (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n) HTA Hconstc HfkcontA).
We prove the intermediate claim Hsumcont: continuous_map A TA R R_standard_topology (compose_fun A (pair_map A (graph A (λy0 : setweighted_sum y0 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R)) add_fun_R).
An exact proof term for the current goal is (add_two_continuous_R A TA (graph A (λy0 : setweighted_sum y0 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R) HTA Hwsncont Htermcont).
We prove the intermediate claim HeqS: ∀y0 : set, y0 Aapply_fun (compose_fun A (pair_map A (graph A (λy0 : setweighted_sum y0 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R)) add_fun_R) y0 = apply_fun (graph A (λy1 : setweighted_sum y1 (ordsucc n) e0)) y0.
Let y0 be given.
Assume Hy0A: y0 A.
We prove the intermediate claim Hwsnfun: function_on (graph A (λy1 : setweighted_sum y1 n e0)) A R.
An exact proof term for the current goal is (continuous_map_function_on A TA R R_standard_topology (graph A (λy1 : setweighted_sum y1 n e0)) Hwsncont).
We prove the intermediate claim Htermfun: function_on (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R) A R.
An exact proof term for the current goal is (continuous_map_function_on A TA R R_standard_topology (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R) Htermcont).
We prove the intermediate claim HwsnR: apply_fun (graph A (λy1 : setweighted_sum y1 n e0)) y0 R.
An exact proof term for the current goal is (Hwsnfun y0 Hy0A).
We prove the intermediate claim HtermR: apply_fun (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R) y0 R.
An exact proof term for the current goal is (Htermfun y0 Hy0A).
We prove the intermediate claim Hadd: apply_fun (compose_fun A (pair_map A (graph A (λy1 : setweighted_sum y1 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R)) add_fun_R) y0 = add_SNo (apply_fun (graph A (λy1 : setweighted_sum y1 n e0)) y0) (apply_fun (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R) y0).
An exact proof term for the current goal is (add_of_pair_map_apply A (graph A (λy1 : setweighted_sum y1 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R) y0 Hy0A HwsnR HtermR).
rewrite the current goal using Hadd (from left to right).
We prove the intermediate claim Happwsn: apply_fun (graph A (λy1 : setweighted_sum y1 n e0)) y0 = weighted_sum y0 n e0.
An exact proof term for the current goal is (apply_fun_graph A (λy1 : setweighted_sum y1 n e0) y0 Hy0A).
rewrite the current goal using Happwsn (from left to right).
We prove the intermediate claim HconstcR: apply_fun (const_fun A (apply_fun coef_of (apply_fun e0 n))) y0 R.
We prove the intermediate claim HconstEq: apply_fun (const_fun A (apply_fun coef_of (apply_fun e0 n))) y0 = apply_fun coef_of (apply_fun e0 n).
An exact proof term for the current goal is (const_fun_apply A (apply_fun coef_of (apply_fun e0 n)) y0 Hy0A).
rewrite the current goal using HconstEq (from left to right).
An exact proof term for the current goal is HcR.
We prove the intermediate claim Hfkfun: function_on (apply_fun e0 n) A R.
An exact proof term for the current goal is (continuous_map_function_on A TA R R_standard_topology (apply_fun e0 n) HfkcontA).
We prove the intermediate claim HfkR: apply_fun (apply_fun e0 n) y0 R.
An exact proof term for the current goal is (Hfkfun y0 Hy0A).
We prove the intermediate claim Hmul: apply_fun (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R) y0 = mul_SNo (apply_fun (const_fun A (apply_fun coef_of (apply_fun e0 n))) y0) (apply_fun (apply_fun e0 n) y0).
An exact proof term for the current goal is (mul_of_pair_map_apply A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n) y0 Hy0A HconstcR HfkR).
rewrite the current goal using Hmul (from left to right).
We prove the intermediate claim HconstEq2: apply_fun (const_fun A (apply_fun coef_of (apply_fun e0 n))) y0 = apply_fun coef_of (apply_fun e0 n).
An exact proof term for the current goal is (const_fun_apply A (apply_fun coef_of (apply_fun e0 n)) y0 Hy0A).
rewrite the current goal using HconstEq2 (from left to right).
We prove the intermediate claim HappS: apply_fun (graph A (λy1 : setweighted_sum y1 (ordsucc n) e0)) y0 = weighted_sum y0 (ordsucc n) e0.
An exact proof term for the current goal is (apply_fun_graph A (λy1 : setweighted_sum y1 (ordsucc n) e0) y0 Hy0A).
rewrite the current goal using HappS (from left to right).
We prove the intermediate claim HwsS: weighted_sum y0 (ordsucc n) e0 = weighted_step y0 e0 n (weighted_sum y0 n e0).
An exact proof term for the current goal is (weighted_sum_S y0 e0 n HnNat).
rewrite the current goal using HwsS (from left to right).
We prove the intermediate claim HstepDef: weighted_step y0 e0 n (weighted_sum y0 n e0) = add_SNo (weighted_sum y0 n e0) (mul_SNo (apply_fun coef_of (apply_fun e0 n)) (apply_fun (apply_fun e0 n) y0)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
Use reflexivity.
We prove the intermediate claim Hsumfun: function_on (compose_fun A (pair_map A (graph A (λy0 : setweighted_sum y0 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R)) add_fun_R) A R.
An exact proof term for the current goal is (continuous_map_function_on A TA R R_standard_topology (compose_fun A (pair_map A (graph A (λy0 : setweighted_sum y0 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R)) add_fun_R) Hsumcont).
We prove the intermediate claim HgSfun: function_on (graph A (λy1 : setweighted_sum y1 (ordsucc n) e0)) A R.
Let y0 be given.
Assume Hy0A: y0 A.
We will prove apply_fun (graph A (λy1 : setweighted_sum y1 (ordsucc n) e0)) y0 R.
We prove the intermediate claim HappS: apply_fun (graph A (λy1 : setweighted_sum y1 (ordsucc n) e0)) y0 = weighted_sum y0 (ordsucc n) e0.
An exact proof term for the current goal is (apply_fun_graph A (λy1 : setweighted_sum y1 (ordsucc n) e0) y0 Hy0A).
rewrite the current goal using HappS (from left to right).
We prove the intermediate claim HwsS: weighted_sum y0 (ordsucc n) e0 = weighted_step y0 e0 n (weighted_sum y0 n e0).
An exact proof term for the current goal is (weighted_sum_S y0 e0 n HnNat).
rewrite the current goal using HwsS (from left to right).
We prove the intermediate claim Hwsnfun: function_on (graph A (λy1 : setweighted_sum y1 n e0)) A R.
An exact proof term for the current goal is (continuous_map_function_on A TA R R_standard_topology (graph A (λy1 : setweighted_sum y1 n e0)) Hwsncont).
We prove the intermediate claim Happn: apply_fun (graph A (λy1 : setweighted_sum y1 n e0)) y0 = weighted_sum y0 n e0.
An exact proof term for the current goal is (apply_fun_graph A (λy1 : setweighted_sum y1 n e0) y0 Hy0A).
We prove the intermediate claim HaccR: weighted_sum y0 n e0 R.
rewrite the current goal using Happn (from right to left).
An exact proof term for the current goal is (Hwsnfun y0 Hy0A).
We prove the intermediate claim Hy0X: y0 X.
An exact proof term for the current goal is (HNsubX y0 Hy0A).
We prove the intermediate claim HvalR: apply_fun (apply_fun e0 n) y0 R.
An exact proof term for the current goal is (HPval_in_R (apply_fun e0 n) y0 HfkP Hy0X).
We prove the intermediate claim HtermR: mul_SNo (apply_fun coef_of (apply_fun e0 n)) (apply_fun (apply_fun e0 n) y0) R.
An exact proof term for the current goal is (real_mul_SNo (apply_fun coef_of (apply_fun e0 n)) HcR (apply_fun (apply_fun e0 n) y0) HvalR).
We prove the intermediate claim HstepDef: weighted_step y0 e0 n (weighted_sum y0 n e0) = add_SNo (weighted_sum y0 n e0) (mul_SNo (apply_fun coef_of (apply_fun e0 n)) (apply_fun (apply_fun e0 n) y0)).
Use reflexivity.
rewrite the current goal using HstepDef (from left to right).
An exact proof term for the current goal is (real_add_SNo (weighted_sum y0 n e0) HaccR (mul_SNo (apply_fun coef_of (apply_fun e0 n)) (apply_fun (apply_fun e0 n) y0)) HtermR).
An exact proof term for the current goal is (continuous_map_congr_on A TA R R_standard_topology (compose_fun A (pair_map A (graph A (λy0 : setweighted_sum y0 n e0)) (compose_fun A (pair_map A (const_fun A (apply_fun coef_of (apply_fun e0 n))) (apply_fun e0 n)) mul_fun_R)) add_fun_R) (graph A (λy1 : setweighted_sum y1 (ordsucc n) e0)) Hsumcont HgSfun HeqS).
We prove the intermediate claim Hwsn0: Pw n0.
An exact proof term for the current goal is (nat_ind Pw Hbase Hstep n0 Hn0Nat).
We prove the intermediate claim Hn0In: n0 ordsucc n0.
An exact proof term for the current goal is (ordsuccI2 n0).
An exact proof term for the current goal is (Hwsn0 Hn0In).
We prove the intermediate claim HfFunN: function_on f (pickN x) R.
Let y1 be given.
Assume Hy1N: y1 pickN x.
We will prove apply_fun f y1 R.
We prove the intermediate claim Hy1X: y1 X.
An exact proof term for the current goal is (HNsubX y1 Hy1N).
We prove the intermediate claim Hfdef: f = graph X w_of.
Use reflexivity.
We prove the intermediate claim Hfy1: apply_fun f y1 = w_of y1.
rewrite the current goal using Hfdef (from left to right).
An exact proof term for the current goal is (apply_fun_graph X w_of y1 Hy1X).
rewrite the current goal using Hfy1 (from left to right).
We prove the intermediate claim Hw: Pval y1 (w_of y1).
An exact proof term for the current goal is (Hw_of y1 Hy1X).
Apply Hw to the current goal.
Let F be given.
Assume HFpack.
We prove the intermediate claim Hleft: (finite F F P) (∀f0 : set, f0 Papply_fun f0 y1 0f0 F).
An exact proof term for the current goal is (andEL ((finite F F P) (∀f0 : set, f0 Papply_fun f0 y1 0f0 F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e) HFpack).
We prove the intermediate claim Hexn: ∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e.
An exact proof term for the current goal is (andER ((finite F F P) (∀f0 : set, f0 Papply_fun f0 y1 0f0 F)) (∃n : set, n ω ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e) HFpack).
We prove the intermediate claim HfinSub: finite F F P.
An exact proof term for the current goal is (andEL (finite F F P) (∀f0 : set, f0 Papply_fun f0 y1 0f0 F) Hleft).
We prove the intermediate claim Hsupp: ∀f0 : set, f0 Papply_fun f0 y1 0f0 F.
An exact proof term for the current goal is (andER (finite F F P) (∀f0 : set, f0 Papply_fun f0 y1 0f0 F) Hleft).
We prove the intermediate claim HFfin: finite F.
An exact proof term for the current goal is (andEL (finite F) (F P) HfinSub).
We prove the intermediate claim HFsubP: F P.
An exact proof term for the current goal is (andER (finite F) (F P) HfinSub).
Apply Hexn to the current goal.
Let n be given.
Assume Hnpack.
We prove the intermediate claim HnO: n ω.
An exact proof term for the current goal is (andEL (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e) Hnpack).
We prove the intermediate claim Hexe: ∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e.
An exact proof term for the current goal is (andER (n ω) (∃e : set, bijection n F e ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e) Hnpack).
Apply Hexe to the current goal.
Let e be given.
Assume Hepack.
We prove the intermediate claim Hbij: bijection n F e.
An exact proof term for the current goal is (andEL (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e) Hepack).
We prove the intermediate claim Hexp: ∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e.
An exact proof term for the current goal is (andER (bijection n F e) (∃p : set, function_on p (ordsucc n) R apply_fun p Empty = 0 (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) apply_fun p n = 1 w_of y1 = weighted_sum y1 n e) Hepack).
Apply Hexp to the current goal.
Let p be given.
Assume Hppack.
We prove the intermediate claim HppackL: (((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1))) apply_fun p n = 1).
An exact proof term for the current goal is (andEL (((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1))) apply_fun p n = 1) (w_of y1 = weighted_sum y1 n e) Hppack).
We prove the intermediate claim HyEq: w_of y1 = weighted_sum y1 n e.
An exact proof term for the current goal is (andER (((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1))) apply_fun p n = 1) (w_of y1 = weighted_sum y1 n e) Hppack).
We prove the intermediate claim HppackL2: (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)).
An exact proof term for the current goal is (andEL ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1))) (apply_fun p n = 1) HppackL).
We prove the intermediate claim Hpn1: apply_fun p n = 1.
An exact proof term for the current goal is (andER ((function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1))) (apply_fun p n = 1) HppackL).
We prove the intermediate claim HpAB: function_on p (ordsucc n) R apply_fun p Empty = 0.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) HppackL2).
We prove the intermediate claim HpStep: ∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1).
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R apply_fun p Empty = 0) (∀k : set, k napply_fun p (ordsucc k) = add_SNo (apply_fun p k) (apply_fun (apply_fun e k) y1)) HppackL2).
We prove the intermediate claim HpFun: function_on p (ordsucc n) R.
An exact proof term for the current goal is (andEL (function_on p (ordsucc n) R) (apply_fun p Empty = 0) HpAB).
We prove the intermediate claim Hp0: apply_fun p Empty = 0.
An exact proof term for the current goal is (andER (function_on p (ordsucc n) R) (apply_fun p Empty = 0) HpAB).
We prove the intermediate claim Hpos: Rlt 0 (weighted_sum y1 n e).
An exact proof term for the current goal is (weighted_sum_pos_on_point y1 F n e p Hy1X HFfin HFsubP Hsupp HnO Hbij HpFun Hp0 HpStep Hpn1).
We prove the intermediate claim HwsR: weighted_sum y1 n e R.
An exact proof term for the current goal is (RltE_right 0 (weighted_sum y1 n e) Hpos).
rewrite the current goal using HyEq (from left to right).
An exact proof term for the current goal is HwsR.
We prove the intermediate claim Hgf_eq: ∀y0 : set, y0 pickN xapply_fun g y0 = apply_fun f y0.
Let y0 be given.
Assume Hy0N: y0 pickN x.
We prove the intermediate claim Hy0X: y0 X.
An exact proof term for the current goal is (HNsubX y0 Hy0N).
We prove the intermediate claim Hgdef: g = graph (pickN x) (λy0 : setweighted_sum y0 n0 e0).
Use reflexivity.
We prove the intermediate claim Hfdef: f = graph X w_of.
Use reflexivity.
We prove the intermediate claim Hg0: apply_fun g y0 = weighted_sum y0 n0 e0.
rewrite the current goal using Hgdef (from left to right) at position 1.
An exact proof term for the current goal is (apply_fun_graph (pickN x) (λy0 : setweighted_sum y0 n0 e0) y0 Hy0N).
We prove the intermediate claim Hf0: apply_fun f y0 = w_of y0.
rewrite the current goal using Hfdef (from left to right) at position 1.
An exact proof term for the current goal is (apply_fun_graph X w_of y0 Hy0X).
rewrite the current goal using Hg0 (from left to right).
rewrite the current goal using Hf0 (from left to right).
We prove the intermediate claim HwP: Pval y0 (w_of y0).
An exact proof term for the current goal is (Hw_of y0 Hy0X).
Apply HwP to the current goal.
Let F1 be given.
Assume HF1pack.
We prove the intermediate claim HF1core: (finite F1 F1 P) (∀f1 : set, f1 Papply_fun f1 y0 0f1 F1).
An exact proof term for the current goal is (andEL ((finite F1 F1 P) (∀f1 : set, f1 Papply_fun f1 y0 0f1 F1)) (∃n1 : set, n1 ω ∃e1 : set, bijection n1 F1 e1 ∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1) HF1pack).
We prove the intermediate claim Hexn1: ∃n1 : set, n1 ω ∃e1 : set, bijection n1 F1 e1 ∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1.
An exact proof term for the current goal is (andER ((finite F1 F1 P) (∀f1 : set, f1 Papply_fun f1 y0 0f1 F1)) (∃n1 : set, n1 ω ∃e1 : set, bijection n1 F1 e1 ∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1) HF1pack).
Apply Hexn1 to the current goal.
Let n1 be given.
Assume Hn1pack.
We prove the intermediate claim Hn1O: n1 ω.
An exact proof term for the current goal is (andEL (n1 ω) (∃e1 : set, bijection n1 F1 e1 ∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1) Hn1pack).
We prove the intermediate claim Hexe1: ∃e1 : set, bijection n1 F1 e1 ∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1.
An exact proof term for the current goal is (andER (n1 ω) (∃e1 : set, bijection n1 F1 e1 ∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1) Hn1pack).
Apply Hexe1 to the current goal.
Let e1 be given.
Assume He1pack.
We prove the intermediate claim He1bij: bijection n1 F1 e1.
An exact proof term for the current goal is (andEL (bijection n1 F1 e1) (∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1) He1pack).
We prove the intermediate claim Hexp1: ∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1.
An exact proof term for the current goal is (andER (bijection n1 F1 e1) (∃p1 : set, function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0 (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0)) apply_fun p1 n1 = 1 w_of y0 = weighted_sum y0 n1 e1) He1pack).
Apply Hexp1 to the current goal.
Let p1 be given.
Assume Hp1pack.
We prove the intermediate claim Hp1left: (((function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0) (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0))) apply_fun p1 n1 = 1).
An exact proof term for the current goal is (andEL (((function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0) (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0))) apply_fun p1 n1 = 1) (w_of y0 = weighted_sum y0 n1 e1) Hp1pack).
We prove the intermediate claim HwEq: w_of y0 = weighted_sum y0 n1 e1.
An exact proof term for the current goal is (andER (((function_on p1 (ordsucc n1) R apply_fun p1 Empty = 0) (∀k : set, k n1apply_fun p1 (ordsucc k) = add_SNo (apply_fun p1 k) (apply_fun (apply_fun e1 k) y0))) apply_fun p1 n1 = 1) (w_of y0 = weighted_sum y0 n1 e1) Hp1pack).
rewrite the current goal using HwEq (from left to right).
We prove the intermediate claim HF1finSub: finite F1 F1 P.
An exact proof term for the current goal is (andEL (finite F1 F1 P) (∀f1 : set, f1 Papply_fun f1 y0 0f1 F1) HF1core).
We prove the intermediate claim HF1subP: F1 P.
An exact proof term for the current goal is (andER (finite F1) (F1 P) HF1finSub).
We prove the intermediate claim He1fun: function_on e1 n1 F1.
An exact proof term for the current goal is (andEL (function_on e1 n1 F1) (∀y : set, y F1∃x0 : set, x0 n1 apply_fun e1 x0 = y (∀x' : set, x' n1apply_fun e1 x' = yx' = x0)) He1bij).
We prove the intermediate claim He1uniq: ∀y : set, y F1∃x0 : set, x0 n1 apply_fun e1 x0 = y (∀x' : set, x' n1apply_fun e1 x' = yx' = x0).
An exact proof term for the current goal is (andER (function_on e1 n1 F1) (∀y : set, y F1∃x0 : set, x0 n1 apply_fun e1 x0 = y (∀x' : set, x' n1apply_fun e1 x' = yx' = x0)) He1bij).
We prove the intermediate claim HekP: ∀k : set, k n1apply_fun e1 k P.
Let k be given.
Assume Hk: k n1.
We prove the intermediate claim HkF1: apply_fun e1 k F1.
An exact proof term for the current goal is (He1fun k Hk).
An exact proof term for the current goal is (HF1subP (apply_fun e1 k) HkF1).
We prove the intermediate claim Hek0: ∀k : set, k n1¬ (apply_fun e1 k F0)apply_fun (apply_fun e1 k) y0 = 0.
Let k be given.
Assume Hk: k n1.
Assume HnotF0: ¬ (apply_fun e1 k F0).
An exact proof term for the current goal is (Hzero_on_N y0 (apply_fun e1 k) Hy0N (HekP k Hk) HnotF0).
We prove the intermediate claim He0fun: function_on e0 n0 F0.
An exact proof term for the current goal is (andEL (function_on e0 n0 F0) (∀y : set, y F0∃x0 : set, x0 n0 apply_fun e0 x0 = y (∀x' : set, x' n0apply_fun e0 x' = yx' = x0)) Hbij0).
We prove the intermediate claim He0uniq: ∀y : set, y F0∃x0 : set, x0 n0 apply_fun e0 x0 = y (∀x' : set, x' n0apply_fun e0 x' = yx' = x0).
An exact proof term for the current goal is (andER (function_on e0 n0 F0) (∀y : set, y F0∃x0 : set, x0 n0 apply_fun e0 x0 = y (∀x' : set, x' n0apply_fun e0 x' = yx' = x0)) Hbij0).
We prove the intermediate claim He0kP: ∀k : set, k n0apply_fun e0 k P.
Let k be given.
Assume Hk: k n0.
We prove the intermediate claim HkF0: apply_fun e0 k F0.
An exact proof term for the current goal is (He0fun k Hk).
An exact proof term for the current goal is (HF0subP (apply_fun e0 k) HkF0).
We prove the intermediate claim HF1covers_nonzero: ∀f1 : set, f1 Papply_fun f1 y0 0f1 F1.
An exact proof term for the current goal is (andER (finite F1 F1 P) (∀f1 : set, f1 Papply_fun f1 y0 0f1 F1) HF1core).
We prove the intermediate claim He0k0: ∀k : set, k n0¬ (apply_fun e0 k F1)apply_fun (apply_fun e0 k) y0 = 0.
Let k be given.
Assume Hk: k n0.
Assume HnotF1: ¬ (apply_fun e0 k F1).
Apply (xm (apply_fun (apply_fun e0 k) y0 = 0)) to the current goal.
Assume Heq0: apply_fun (apply_fun e0 k) y0 = 0.
An exact proof term for the current goal is Heq0.
Assume Hneq0: ¬ (apply_fun (apply_fun e0 k) y0 = 0).
Apply FalseE to the current goal.
We prove the intermediate claim Hne0: apply_fun (apply_fun e0 k) y0 0.
Assume Heq0: apply_fun (apply_fun e0 k) y0 = 0.
An exact proof term for the current goal is (Hneq0 Heq0).
We prove the intermediate claim HkF1: apply_fun e0 k F1.
An exact proof term for the current goal is (HF1covers_nonzero (apply_fun e0 k) (He0kP k Hk) Hne0).
An exact proof term for the current goal is (HnotF1 HkF1).
We prove the intermediate claim HF1diff0: ∀f : set, f F1¬ (f F0)apply_fun f y0 = 0.
Let f be given.
Assume HfF1: f F1.
Assume HnotF0: ¬ (f F0).
We prove the intermediate claim HfP: f P.
An exact proof term for the current goal is (HF1subP f HfF1).
An exact proof term for the current goal is (Hzero_on_N y0 f Hy0N HfP HnotF0).
We prove the intermediate claim HF0diff1: ∀f : set, f F0¬ (f F1)apply_fun f y0 = 0.
Let f be given.
Assume HfF0: f F0.
Assume HnotF1: ¬ (f F1).
Apply (xm (apply_fun f y0 = 0)) to the current goal.
Assume Heq0: apply_fun f y0 = 0.
An exact proof term for the current goal is Heq0.
Assume Hneq0: ¬ (apply_fun f y0 = 0).
Apply FalseE to the current goal.
We prove the intermediate claim HfP: f P.
An exact proof term for the current goal is (HF0subP f HfF0).
We prove the intermediate claim Hne0: apply_fun f y0 0.
Assume Heq0: apply_fun f y0 = 0.
An exact proof term for the current goal is (Hneq0 Heq0).
We prove the intermediate claim HfF1: f F1.
An exact proof term for the current goal is (HF1covers_nonzero f HfP Hne0).
An exact proof term for the current goal is (HnotF1 HfF1).
We prove the intermediate claim Hsum_indep: weighted_sum y0 n0 e0 = weighted_sum y0 n1 e1.
We prove the intermediate claim HF1fin: finite F1.
We prove the intermediate claim HF1finSub: finite F1 F1 P.
An exact proof term for the current goal is (andEL (finite F1 F1 P) (∀f1 : set, f1 Papply_fun f1 y0 0f1 F1) HF1core).
An exact proof term for the current goal is (andEL (finite F1) (F1 P) HF1finSub).
Set FU to be the term F0 F1.
We prove the intermediate claim HFUfin: finite FU.
An exact proof term for the current goal is (binunion_finite F0 HF0fin F1 HF1fin).
We prove the intermediate claim HexneU: ∃nU eU : set, nU ω bijection nU FU eU.
An exact proof term for the current goal is (finite_ex_bijection_from_omega FU HFUfin).
Apply HexneU to the current goal.
Let nU be given.
Assume HexeU: ∃eU : set, nU ω bijection nU FU eU.
Apply HexeU to the current goal.
Let eU be given.
Assume HneU: nU ω bijection nU FU eU.
We prove the intermediate claim Hsum0U: weighted_sum y0 n0 e0 = weighted_sum y0 nU eU.
We prove the intermediate claim HFUdiff0_zero: ∀f : set, f FU¬ (f F0)apply_fun f y0 = 0.
Let f be given.
Assume HfFU: f FU.
Assume HnotF0: ¬ (f F0).
We prove the intermediate claim HfCase: f F0 f F1.
An exact proof term for the current goal is (binunionE F0 F1 f HfFU).
Apply (HfCase (apply_fun f y0 = 0)) to the current goal.
Assume HfF0: f F0.
Apply FalseE to the current goal.
An exact proof term for the current goal is (HnotF0 HfF0).
Assume HfF1: f F1.
An exact proof term for the current goal is (HF1diff0 f HfF1 HnotF0).
We prove the intermediate claim HeUfun: function_on eU nU FU.
An exact proof term for the current goal is (andEL (function_on eU nU FU) (∀y : set, y FU∃x0 : set, x0 nU apply_fun eU x0 = y (∀x' : set, x' nUapply_fun eU x' = yx' = x0)) (andER (nU ω) (bijection nU FU eU) HneU)).
We prove the intermediate claim HeUk0: ∀k : set, k nU¬ (apply_fun eU k F0)apply_fun (apply_fun eU k) y0 = 0.
Let k be given.
Assume Hk: k nU.
Assume HnotF0: ¬ (apply_fun eU k F0).
We prove the intermediate claim HkFU: apply_fun eU k FU.
An exact proof term for the current goal is (HeUfun k Hk).
An exact proof term for the current goal is (HFUdiff0_zero (apply_fun eU k) HkFU HnotF0).
Set D to be the term FU F0.
Apply (xm (D = Empty)) to the current goal.
Assume HDEmpty: D = Empty.
We prove the intermediate claim HFUsubF0: FU F0.
Let u be given.
Assume HuFU: u FU.
Apply (xm (u F0)) to the current goal.
Assume HuF0: u F0.
An exact proof term for the current goal is HuF0.
Assume HnotF0: ¬ (u F0).
Apply FalseE to the current goal.
We prove the intermediate claim HuD: u D.
An exact proof term for the current goal is (setminusI FU F0 u HuFU HnotF0).
We prove the intermediate claim HuEmpty: u Empty.
rewrite the current goal using HDEmpty (from right to left) at position 1.
An exact proof term for the current goal is HuD.
An exact proof term for the current goal is (EmptyE u HuEmpty).
We prove the intermediate claim HF1subF0: F1 F0.
Let u be given.
Assume HuF1: u F1.
We prove the intermediate claim HuFU: u FU.
An exact proof term for the current goal is (binunionI2 F0 F1 u HuF1).
An exact proof term for the current goal is (HFUsubF0 u HuFU).
We prove the intermediate claim HF0subFU: F0 FU.
Let u be given.
Assume HuF0: u F0.
An exact proof term for the current goal is (binunionI1 F0 F1 u HuF0).
We prove the intermediate claim HeqFU: FU = F0.
Apply set_ext to the current goal.
An exact proof term for the current goal is HFUsubF0.
An exact proof term for the current goal is HF0subFU.
We prove the intermediate claim HnUO: nU ω.
An exact proof term for the current goal is (andEL (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HbijU: bijection nU FU eU.
An exact proof term for the current goal is (andER (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HbijUF0: bijection nU F0 eU.
rewrite the current goal using HeqFU (from right to left).
An exact proof term for the current goal is HbijU.
We prove the intermediate claim Heq_n0F0: equip n0 F0.
An exact proof term for the current goal is (equip_of_bijection n0 F0 e0 Hbij0).
We prove the intermediate claim Heq_nUF0: equip nU F0.
An exact proof term for the current goal is (equip_of_bijection nU F0 eU HbijUF0).
We prove the intermediate claim Heq_n0nU: equip n0 nU.
An exact proof term for the current goal is (equip_tra n0 F0 nU Heq_n0F0 (equip_sym nU F0 Heq_nUF0)).
We prove the intermediate claim HnEq: n0 = nU.
An exact proof term for the current goal is (equip_omega_eq n0 nU Hn0O HnUO Heq_n0nU).
rewrite the current goal using HnEq (from right to left).
We prove the intermediate claim HbijU0: bijection n0 F0 eU.
rewrite the current goal using HnEq (from left to right).
An exact proof term for the current goal is HbijUF0.
We prove the intermediate claim HvalR0: ∀f : set, f F0apply_fun f y0 R.
Let f be given.
Assume HfF0: f F0.
We prove the intermediate claim HfP: f P.
An exact proof term for the current goal is (HF0subP f HfF0).
An exact proof term for the current goal is (HPval_in_R f y0 HfP Hy0X).
We prove the intermediate claim HcoefR0: ∀f : set, f F0apply_fun coef_of f R.
Let f be given.
Assume HfF0: f F0.
We prove the intermediate claim HfP: f P.
An exact proof term for the current goal is (HF0subP f HfF0).
We prove the intermediate claim Hpos: Rlt 0 (apply_fun coef_of f).
An exact proof term for the current goal is (Hcoef_pos f HfP).
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of f) Hpos).
An exact proof term for the current goal is (weighted_sum_bijection_indep_real y0 n0 F0 e0 eU Hy0X Hn0O HF0subP HvalR0 HcoefR0 Hbij0 HbijU0).
Assume HDne: ¬ (D = Empty).
We prove the intermediate claim HDnon: D Empty.
Assume Heq: D = Empty.
An exact proof term for the current goal is (HDne Heq).
We prove the intermediate claim Hexf: ∃f : set, f D.
An exact proof term for the current goal is (nonempty_has_element D HDnon).
Apply Hexf to the current goal.
Let f be given.
Assume HfD: f D.
We prove the intermediate claim HfFU: f FU.
An exact proof term for the current goal is (setminusE1 FU F0 f HfD).
We prove the intermediate claim HfnotF0: ¬ (f F0).
An exact proof term for the current goal is (setminusE2 FU F0 f HfD).
We prove the intermediate claim Hfy0: apply_fun f y0 = 0.
An exact proof term for the current goal is (HFUdiff0_zero f HfFU HfnotF0).
We prove the intermediate claim HnUO: nU ω.
An exact proof term for the current goal is (andEL (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HbijU: bijection nU FU eU.
An exact proof term for the current goal is (andER (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HnUNat: nat_p nU.
An exact proof term for the current goal is (omega_nat_p nU HnUO).
We prove the intermediate claim HnUcase: nU = 0 ∃m : set, nat_p m nU = ordsucc m.
An exact proof term for the current goal is (nat_inv nU HnUNat).
Apply (HnUcase (weighted_sum y0 n0 e0 = weighted_sum y0 nU eU)) to the current goal.
Assume HnU0: nU = 0.
Apply FalseE to the current goal.
We prove the intermediate claim Hbij0: bijection 0 FU eU.
rewrite the current goal using HnU0 (from right to left).
An exact proof term for the current goal is HbijU.
We prove the intermediate claim Hexk: ∃k : set, k 0 apply_fun eU k = f.
An exact proof term for the current goal is (bijection_surj 0 FU eU f Hbij0 HfFU).
Apply Hexk to the current goal.
Let k be given.
Assume Hkpair.
We prove the intermediate claim Hk0: k 0.
An exact proof term for the current goal is (andEL (k 0) (apply_fun eU k = f) Hkpair).
An exact proof term for the current goal is (EmptyE k Hk0).
Assume Hexm: ∃m : set, nat_p m nU = ordsucc m.
Apply Hexm to the current goal.
Let m be given.
Assume Hmconj: nat_p m nU = ordsucc m.
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (andEL (nat_p m) (nU = ordsucc m) Hmconj).
We prove the intermediate claim HnUEq: nU = ordsucc m.
An exact proof term for the current goal is (andER (nat_p m) (nU = ordsucc m) Hmconj).
We prove the intermediate claim HmO: m ω.
An exact proof term for the current goal is (nat_p_omega m HmNat).
We prove the intermediate claim HF0subFU: F0 FU.
Let u be given.
Assume Hu: u F0.
An exact proof term for the current goal is (binunionI1 F0 F1 u Hu).
We prove the intermediate claim HFUsubP: FU P.
Let u be given.
Assume Hu: u FU.
Apply (binunionE F0 F1 u Hu) to the current goal.
Assume Hu0: u F0.
An exact proof term for the current goal is (HF0subP u Hu0).
Assume Hu1: u F1.
An exact proof term for the current goal is (HF1subP u Hu1).
We prove the intermediate claim HvalFU: ∀g : set, g FUapply_fun g y0 R.
Let g be given.
Assume HgFU: g FU.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HFUsubP g HgFU).
An exact proof term for the current goal is (HPval_in_R g y0 HgP Hy0X).
We prove the intermediate claim HcoefFU: ∀g : set, g FUapply_fun coef_of g R.
Let g be given.
Assume HgFU: g FU.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HFUsubP g HgFU).
We prove the intermediate claim Hpos: Rlt 0 (apply_fun coef_of g).
An exact proof term for the current goal is (Hcoef_pos g HgP).
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of g) Hpos).
We prove the intermediate claim HbijU2: bijection (ordsucc m) FU eU.
rewrite the current goal using HnUEq (from right to left).
An exact proof term for the current goal is HbijU.
We prove the intermediate claim Hremove: ∃eU' : set, bijection m (FU {f}) eU' weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU'.
An exact proof term for the current goal is (weighted_sum_bijection_remove_one_zero_real y0 m FU eU f Hy0X HmO HFUsubP HvalFU HcoefFU HbijU2 HfFU Hfy0).
Apply Hremove to the current goal.
Let eU' be given.
Assume HeU'pack.
We prove the intermediate claim HwsU: weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU'.
An exact proof term for the current goal is (andER (bijection m (FU {f}) eU') (weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU') HeU'pack).
We prove the intermediate claim Hrec: weighted_sum y0 n0 e0 = weighted_sum y0 m eU'.
We prove the intermediate claim HbijU': bijection m (FU {f}) eU'.
An exact proof term for the current goal is (andEL (bijection m (FU {f}) eU') (weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU') HeU'pack).
We prove the intermediate claim HFminsub: (FU {f}) FU.
An exact proof term for the current goal is (setminus_Subq FU {f}).
We prove the intermediate claim HFminfin: finite (FU {f}).
An exact proof term for the current goal is (Subq_finite FU HFUfin (FU {f}) HFminsub).
We prove the intermediate claim HFminsubP: (FU {f}) P.
An exact proof term for the current goal is (Subq_tra (FU {f}) FU P HFminsub HFUsubP).
We prove the intermediate claim HF0subFmin: F0 (FU {f}).
Let u be given.
Assume HuF0: u F0.
We prove the intermediate claim HuFU: u FU.
An exact proof term for the current goal is (HF0subFU u HuF0).
We prove the intermediate claim HuNot: u {f}.
Assume HuEq: u {f}.
We prove the intermediate claim HuEqF: u = f.
An exact proof term for the current goal is (SingE f u HuEq).
We will prove False.
Apply HfnotF0 to the current goal.
rewrite the current goal using HuEqF (from right to left).
An exact proof term for the current goal is HuF0.
An exact proof term for the current goal is (setminusI FU {f} u HuFU HuNot).
We prove the intermediate claim HvalR0: ∀g : set, g F0apply_fun g y0 R.
Let g be given.
Assume HgF0: g F0.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HF0subP g HgF0).
An exact proof term for the current goal is (HPval_in_R g y0 HgP Hy0X).
We prove the intermediate claim HcoefR0: ∀g : set, g F0apply_fun coef_of g R.
Let g be given.
Assume HgF0: g F0.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HF0subP g HgF0).
We prove the intermediate claim Hpos: Rlt 0 (apply_fun coef_of g).
An exact proof term for the current goal is (Hcoef_pos g HgP).
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of g) Hpos).
We prove the intermediate claim HzeroOut: ∀g : set, g (FU {f})¬ (g F0)apply_fun g y0 = 0.
Let g be given.
Assume HgF: g (FU {f}).
Assume HgNot0: ¬ (g F0).
We prove the intermediate claim HgFU: g FU.
An exact proof term for the current goal is (setminusE1 FU {f} g HgF).
An exact proof term for the current goal is (HFUdiff0_zero g HgFU HgNot0).
An exact proof term for the current goal is (weighted_sum_bijection_zero_outside_real y0 n0 F0 e0 m (FU {f}) eU' Hy0X Hn0O HFminfin HF0subFmin HFminsubP HF0subP HvalR0 HcoefR0 HzeroOut Hbij0 HmO HbijU').
rewrite the current goal using HnUEq (from left to right).
rewrite the current goal using HwsU (from left to right).
An exact proof term for the current goal is Hrec.
We prove the intermediate claim Hsum1U: weighted_sum y0 n1 e1 = weighted_sum y0 nU eU.
We prove the intermediate claim HFUdiff1_zero: ∀f : set, f FU¬ (f F1)apply_fun f y0 = 0.
Let f be given.
Assume HfFU: f FU.
Assume HnotF1: ¬ (f F1).
We prove the intermediate claim HfCase: f F0 f F1.
An exact proof term for the current goal is (binunionE F0 F1 f HfFU).
Apply (HfCase (apply_fun f y0 = 0)) to the current goal.
Assume HfF0: f F0.
An exact proof term for the current goal is (HF0diff1 f HfF0 HnotF1).
Assume HfF1: f F1.
Apply FalseE to the current goal.
An exact proof term for the current goal is (HnotF1 HfF1).
We prove the intermediate claim HeUfun: function_on eU nU FU.
An exact proof term for the current goal is (andEL (function_on eU nU FU) (∀y : set, y FU∃x0 : set, x0 nU apply_fun eU x0 = y (∀x' : set, x' nUapply_fun eU x' = yx' = x0)) (andER (nU ω) (bijection nU FU eU) HneU)).
We prove the intermediate claim HeUk0: ∀k : set, k nU¬ (apply_fun eU k F1)apply_fun (apply_fun eU k) y0 = 0.
Let k be given.
Assume Hk: k nU.
Assume HnotF1: ¬ (apply_fun eU k F1).
We prove the intermediate claim HkFU: apply_fun eU k FU.
An exact proof term for the current goal is (HeUfun k Hk).
An exact proof term for the current goal is (HFUdiff1_zero (apply_fun eU k) HkFU HnotF1).
Set D to be the term FU F1.
Apply (xm (D = Empty)) to the current goal.
Assume HDEmpty: D = Empty.
We prove the intermediate claim HFUsubF1: FU F1.
Let u be given.
Assume HuFU: u FU.
Apply (xm (u F1)) to the current goal.
Assume HuF1: u F1.
An exact proof term for the current goal is HuF1.
Assume HnotF1: ¬ (u F1).
Apply FalseE to the current goal.
We prove the intermediate claim HuD: u D.
An exact proof term for the current goal is (setminusI FU F1 u HuFU HnotF1).
We prove the intermediate claim HuEmpty: u Empty.
rewrite the current goal using HDEmpty (from right to left) at position 1.
An exact proof term for the current goal is HuD.
An exact proof term for the current goal is (EmptyE u HuEmpty).
We prove the intermediate claim HF0subF1: F0 F1.
Let u be given.
Assume HuF0: u F0.
We prove the intermediate claim HuFU: u FU.
An exact proof term for the current goal is (binunionI1 F0 F1 u HuF0).
An exact proof term for the current goal is (HFUsubF1 u HuFU).
We prove the intermediate claim HF1subFU: F1 FU.
Let u be given.
Assume HuF1: u F1.
An exact proof term for the current goal is (binunionI2 F0 F1 u HuF1).
We prove the intermediate claim HeqFU: FU = F1.
Apply set_ext to the current goal.
An exact proof term for the current goal is HFUsubF1.
An exact proof term for the current goal is HF1subFU.
We prove the intermediate claim HnUO: nU ω.
An exact proof term for the current goal is (andEL (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HbijU: bijection nU FU eU.
An exact proof term for the current goal is (andER (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HbijUF1: bijection nU F1 eU.
rewrite the current goal using HeqFU (from right to left).
An exact proof term for the current goal is HbijU.
We prove the intermediate claim Heq_n1F1: equip n1 F1.
An exact proof term for the current goal is (equip_of_bijection n1 F1 e1 He1bij).
We prove the intermediate claim Heq_nUF1: equip nU F1.
An exact proof term for the current goal is (equip_of_bijection nU F1 eU HbijUF1).
We prove the intermediate claim Heq_n1nU: equip n1 nU.
An exact proof term for the current goal is (equip_tra n1 F1 nU Heq_n1F1 (equip_sym nU F1 Heq_nUF1)).
We prove the intermediate claim HnEq: n1 = nU.
An exact proof term for the current goal is (equip_omega_eq n1 nU Hn1O HnUO Heq_n1nU).
rewrite the current goal using HnEq (from right to left).
We prove the intermediate claim HbijU1: bijection n1 F1 eU.
rewrite the current goal using HnEq (from left to right).
An exact proof term for the current goal is HbijUF1.
We prove the intermediate claim HvalR1: ∀f : set, f F1apply_fun f y0 R.
Let f be given.
Assume HfF1: f F1.
We prove the intermediate claim HfP: f P.
An exact proof term for the current goal is (HF1subP f HfF1).
An exact proof term for the current goal is (HPval_in_R f y0 HfP Hy0X).
We prove the intermediate claim HcoefR1: ∀f : set, f F1apply_fun coef_of f R.
Let f be given.
Assume HfF1: f F1.
We prove the intermediate claim HfP: f P.
An exact proof term for the current goal is (HF1subP f HfF1).
We prove the intermediate claim Hpos: Rlt 0 (apply_fun coef_of f).
An exact proof term for the current goal is (Hcoef_pos f HfP).
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of f) Hpos).
An exact proof term for the current goal is (weighted_sum_bijection_indep_real y0 n1 F1 e1 eU Hy0X Hn1O HF1subP HvalR1 HcoefR1 He1bij HbijU1).
Assume HDne: ¬ (D = Empty).
We prove the intermediate claim HDnon: D Empty.
Assume Heq: D = Empty.
An exact proof term for the current goal is (HDne Heq).
We prove the intermediate claim Hexf: ∃f : set, f D.
An exact proof term for the current goal is (nonempty_has_element D HDnon).
Apply Hexf to the current goal.
Let f be given.
Assume HfD: f D.
We prove the intermediate claim HfFU: f FU.
An exact proof term for the current goal is (setminusE1 FU F1 f HfD).
We prove the intermediate claim HfnotF1: ¬ (f F1).
An exact proof term for the current goal is (setminusE2 FU F1 f HfD).
We prove the intermediate claim Hfy0: apply_fun f y0 = 0.
An exact proof term for the current goal is (HFUdiff1_zero f HfFU HfnotF1).
We prove the intermediate claim HnUO: nU ω.
An exact proof term for the current goal is (andEL (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HbijU: bijection nU FU eU.
An exact proof term for the current goal is (andER (nU ω) (bijection nU FU eU) HneU).
We prove the intermediate claim HnUNat: nat_p nU.
An exact proof term for the current goal is (omega_nat_p nU HnUO).
We prove the intermediate claim HnUcase: nU = 0 ∃m : set, nat_p m nU = ordsucc m.
An exact proof term for the current goal is (nat_inv nU HnUNat).
Apply (HnUcase (weighted_sum y0 n1 e1 = weighted_sum y0 nU eU)) to the current goal.
Assume HnU0: nU = 0.
Apply FalseE to the current goal.
We prove the intermediate claim Hbij0: bijection 0 FU eU.
rewrite the current goal using HnU0 (from right to left).
An exact proof term for the current goal is HbijU.
We prove the intermediate claim Hexk: ∃k : set, k 0 apply_fun eU k = f.
An exact proof term for the current goal is (bijection_surj 0 FU eU f Hbij0 HfFU).
Apply Hexk to the current goal.
Let k be given.
Assume Hkpair.
We prove the intermediate claim Hk0: k 0.
An exact proof term for the current goal is (andEL (k 0) (apply_fun eU k = f) Hkpair).
An exact proof term for the current goal is (EmptyE k Hk0).
Assume Hexm: ∃m : set, nat_p m nU = ordsucc m.
Apply Hexm to the current goal.
Let m be given.
Assume Hmconj: nat_p m nU = ordsucc m.
We prove the intermediate claim HmNat: nat_p m.
An exact proof term for the current goal is (andEL (nat_p m) (nU = ordsucc m) Hmconj).
We prove the intermediate claim HnUEq: nU = ordsucc m.
An exact proof term for the current goal is (andER (nat_p m) (nU = ordsucc m) Hmconj).
We prove the intermediate claim HmO: m ω.
An exact proof term for the current goal is (nat_p_omega m HmNat).
We prove the intermediate claim HF1subFU: F1 FU.
Let u be given.
Assume Hu: u F1.
An exact proof term for the current goal is (binunionI2 F0 F1 u Hu).
We prove the intermediate claim HFUsubP: FU P.
Let u be given.
Assume Hu: u FU.
Apply (binunionE F0 F1 u Hu) to the current goal.
Assume Hu0: u F0.
An exact proof term for the current goal is (HF0subP u Hu0).
Assume Hu1: u F1.
An exact proof term for the current goal is (HF1subP u Hu1).
We prove the intermediate claim HvalFU: ∀g : set, g FUapply_fun g y0 R.
Let g be given.
Assume HgFU: g FU.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HFUsubP g HgFU).
An exact proof term for the current goal is (HPval_in_R g y0 HgP Hy0X).
We prove the intermediate claim HcoefFU: ∀g : set, g FUapply_fun coef_of g R.
Let g be given.
Assume HgFU: g FU.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HFUsubP g HgFU).
We prove the intermediate claim Hpos: Rlt 0 (apply_fun coef_of g).
An exact proof term for the current goal is (Hcoef_pos g HgP).
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of g) Hpos).
We prove the intermediate claim HbijU2: bijection (ordsucc m) FU eU.
rewrite the current goal using HnUEq (from right to left).
An exact proof term for the current goal is HbijU.
We prove the intermediate claim Hremove: ∃eU' : set, bijection m (FU {f}) eU' weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU'.
An exact proof term for the current goal is (weighted_sum_bijection_remove_one_zero_real y0 m FU eU f Hy0X HmO HFUsubP HvalFU HcoefFU HbijU2 HfFU Hfy0).
Apply Hremove to the current goal.
Let eU' be given.
Assume HeU'pack.
We prove the intermediate claim HwsU: weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU'.
An exact proof term for the current goal is (andER (bijection m (FU {f}) eU') (weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU') HeU'pack).
We prove the intermediate claim Hrec: weighted_sum y0 n1 e1 = weighted_sum y0 m eU'.
We prove the intermediate claim HbijU': bijection m (FU {f}) eU'.
An exact proof term for the current goal is (andEL (bijection m (FU {f}) eU') (weighted_sum y0 (ordsucc m) eU = weighted_sum y0 m eU') HeU'pack).
We prove the intermediate claim HFminsub: (FU {f}) FU.
An exact proof term for the current goal is (setminus_Subq FU {f}).
We prove the intermediate claim HFminfin: finite (FU {f}).
An exact proof term for the current goal is (Subq_finite FU HFUfin (FU {f}) HFminsub).
We prove the intermediate claim HFminsubP: (FU {f}) P.
An exact proof term for the current goal is (Subq_tra (FU {f}) FU P HFminsub HFUsubP).
We prove the intermediate claim HF1subFU: F1 FU.
Let u be given.
Assume HuF1: u F1.
An exact proof term for the current goal is (binunionI2 F0 F1 u HuF1).
We prove the intermediate claim HF1subFmin: F1 (FU {f}).
Let u be given.
Assume HuF1: u F1.
We prove the intermediate claim HuFU: u FU.
An exact proof term for the current goal is (HF1subFU u HuF1).
We prove the intermediate claim HuNot: u {f}.
Assume HuEq: u {f}.
We prove the intermediate claim HuEqF: u = f.
An exact proof term for the current goal is (SingE f u HuEq).
We will prove False.
Apply HfnotF1 to the current goal.
rewrite the current goal using HuEqF (from right to left).
An exact proof term for the current goal is HuF1.
An exact proof term for the current goal is (setminusI FU {f} u HuFU HuNot).
We prove the intermediate claim HvalR1: ∀g : set, g F1apply_fun g y0 R.
Let g be given.
Assume HgF1: g F1.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HF1subP g HgF1).
An exact proof term for the current goal is (HPval_in_R g y0 HgP Hy0X).
We prove the intermediate claim HcoefR1: ∀g : set, g F1apply_fun coef_of g R.
Let g be given.
Assume HgF1: g F1.
We prove the intermediate claim HgP: g P.
An exact proof term for the current goal is (HF1subP g HgF1).
We prove the intermediate claim Hpos: Rlt 0 (apply_fun coef_of g).
An exact proof term for the current goal is (Hcoef_pos g HgP).
An exact proof term for the current goal is (RltE_right 0 (apply_fun coef_of g) Hpos).
We prove the intermediate claim HzeroOut: ∀g : set, g (FU {f})¬ (g F1)apply_fun g y0 = 0.
Let g be given.
Assume HgF: g (FU {f}).
Assume HgNot1: ¬ (g F1).
We prove the intermediate claim HgFU: g FU.
An exact proof term for the current goal is (setminusE1 FU {f} g HgF).
An exact proof term for the current goal is (HFUdiff1_zero g HgFU HgNot1).
An exact proof term for the current goal is (weighted_sum_bijection_zero_outside_real y0 n1 F1 e1 m (FU {f}) eU' Hy0X Hn1O HFminfin HF1subFmin HFminsubP HF1subP HvalR1 HcoefR1 HzeroOut He1bij HmO HbijU').
rewrite the current goal using HnUEq (from left to right).
rewrite the current goal using HwsU (from left to right).
An exact proof term for the current goal is Hrec.
rewrite the current goal using Hsum0U (from left to right).
rewrite the current goal using Hsum1U (from right to left).
Use reflexivity.
An exact proof term for the current goal is Hsum_indep.
An exact proof term for the current goal is (continuous_map_congr_on (pickN x) (subspace_topology X Tx (pickN x)) R R_standard_topology g f Hgcont HfFunN Hgf_eq).
An exact proof term for the current goal is (Hlocal_rule f Hlocal).
An exact proof term for the current goal is Hf_cont.
Let x be given.
Assume HxX: x X.
An exact proof term for the current goal is (HfPos x HxX).
An exact proof term for the current goal is HfLe.