proposition: Lemma process_eval_rec5_draw_win_loss ht (res : estate) l : Hiv l -> ht_valid ht -> \smin_(i <- l) f1 i = loss -> drawwin <= process_eval_rec5 f2 edraw ewin ht res l.
proof: Proof. elim: l ht res => [|i l IH] ht res HHiv Hv; first by rewrite big_nil. rewrite big_cons [process_eval_rec5 _ _ _ _ _ _]/= => H. case E : f2 => [ht1 res1]. have -> : res1 = f2 edraw ewin ht i by rewrite E. have -> : ht1 = f2 edraw ewin ht i by rewrite E. have HHiv1 := Hiv_cons HHiv. have [E1|E1] := leqP res (f2 _ _ _ _). have [E2|/ltnW E2] := leqP (f1 i) (\smin_(j <- l) f1 j). rewrite smin_lel // in H. apply: leq_trans (ge_process_eval_rec5 _ _ _ _ _ _). rewrite (esflip_le lossdraw). apply: leq_trans E1 _. by apply: (H5draw_win_loss HHiv). rewrite smin_ler // in H. by apply: IH => //; apply: (H5draw_win_table HHiv). have [E2|E2] := leqP ewin (f2 _ _ _ _). have [E3|/ltnW E3] := leqP (f1 i) (\smin_(j <- l) f1 j). rewrite smin_lel // in H. have := H5draw_win_loss HHiv Hv H. by rewrite leqNgt (leq_trans _ E2). rewrite smin_ler // in H. by apply: IH => //; apply: (H5draw_win_table HHiv). have [E3|E3] := leqP (f1 i) (\smin_(j <- l) f1 j). rewrite smin_lel // in H. by case: pres2state (H5draw_win_loss HHiv Hv H). rewrite smin_ler // in H; last by apply: ltnW. have [E4|E4] := leqP (f2 _ _ _ _) edraw. have : lossdraw <= f2 edraw ewin ht i. apply: (H5draw_win_ge HHiv) => //. by move: E3; rewrite H; case: f1. case: pres2state E4 => //=. by case: (l) H => //; rewrite big_nil. move: E3 E2; rewrite H. case: f1 (@H5draw_win_draw ht i l HHiv Hv) (@H5draw_win_win ht i l HHiv Hv) => //. by move=> _ -> //. move=> /(_ (refl_equal _)). by rewrite [_ <= edraw]leqNgt E4 andbF. Qed.
imports: HB(structures) mathcomp(all_ssreflect) mathcomp(all_algebra)