proposition: Lemma round_round_plus_radix_ge_3 : (3 <= beta)%Z -> forall (fexp1 fexp2 : Z -> Z), Valid_exp fexp1 -> Valid_exp fexp2 -> forall (choice1 choice2 : Z -> bool), round_round_plus_radix_ge_3_hyp fexp1 fexp2 -> forall x y, generic_format beta fexp1 x -> generic_format beta fexp1 y -> round_round_eq fexp1 fexp2 choice1 choice2 (x + y).
proof: Proof. intros Hbeta fexp1 fexp2 Vfexp1 Vfexp2 choice1 choice2 Hexp x y Fx Fy. unfold round_round_eq. destruct (Rlt_or_le x 0) as [Sx|Sx]; destruct (Rlt_or_le y 0) as [Sy|Sy]. - replace (x + y) with (- (- x - y)); [|ring]. do 3 rewrite round_N_opp. apply Ropp_eq_compat. assert (Px : 0 <= - x); [lra|]. assert (Py : 0 <= - y); [lra|]. apply generic_format_opp in Fx. apply generic_format_opp in Fy. now apply round_round_plus_radix_ge_3_aux. - replace (x + y) with (y - (- x)); [|ring]. assert (Px : 0 <= - x); [lra|]. apply generic_format_opp in Fx. now apply round_round_minus_radix_ge_3_aux. - replace (x + y) with (x - (- y)); [|ring]. assert (Py : 0 <= - y); [lra|]. apply generic_format_opp in Fy. now apply round_round_minus_radix_ge_3_aux. - now apply round_round_plus_radix_ge_3_aux. Qed.
imports: Coq(ZArith Reals Psatz) Core FTZ