Timings for dec_fields.v
Require Import
HoTT.Classes.interfaces.abstract_algebra
HoTT.Classes.interfaces.orders
HoTT.Classes.theory.dec_fields.
Require Export
HoTT.Classes.orders.rings.
Generalizable Variables F f R Fle Flt.
Context `{IsDecField F} `{Apart F} `{!TrivialApart F}
`{!FullPseudoSemiRingOrder Fle Flt} `{DecidablePaths F}.
(* Add Ring F : (stdlib_ring_theory F). *)
Instance pos_dec_recip_compat x : PropHolds (0 < x) -> PropHolds (0 < /x).
apply (strictly_order_reflecting (x *.)).
rewrite dec_recip_inverse by (apply orders.lt_ne_flip;trivial).
Instance nonneg_dec_recip_compat x : PropHolds (0 ≤ x) -> PropHolds (0 ≤ /x).
destruct (dec (x = 0)) as [E2 | E2].
apply pos_dec_recip_compat.
apply symmetric_neq;trivial.
Lemma neg_dec_recip_compat x : x < 0 -> /x < 0.
rewrite dec_recip_negate.
apply pos_dec_recip_compat.
Lemma nonpos_dec_recip_compat x : x ≤ 0 -> /x ≤ 0.
apply flip_nonpos_negate.
rewrite dec_recip_negate.
apply nonneg_dec_recip_compat.
apply flip_nonpos_negate;trivial.
Lemma flip_le_dec_recip x y : 0 < y -> y ≤ x -> /x ≤ /y.
apply (order_reflecting_pos (.*.) x).
apply lt_le_trans with y;trivial.
rewrite dec_recip_inverse.
apply (order_reflecting_pos (.*.) y);trivial.
rewrite (commutativity x), simple_associativity, dec_recip_inverse.
rewrite mult_1_l,mult_1_r.
apply lt_ne_flip;trivial.
apply lt_le_trans with y;trivial.
Lemma flip_le_dec_recip_l x y : 0 < y -> /y ≤ x -> /x ≤ y.
rewrite <-(dec_recip_involutive y).
apply flip_le_dec_recip;trivial.
apply pos_dec_recip_compat;trivial.
Lemma flip_le_dec_recip_r x y : 0 < y -> y ≤ /x -> x ≤ /y.
rewrite <-(dec_recip_involutive x).
apply flip_le_dec_recip;trivial.
Lemma flip_lt_dec_recip x y : 0 < y -> y < x -> /x < /y.
assert (0 < x) by (transitivity y;trivial).
apply (strictly_order_reflecting (x *.)).
rewrite dec_recip_inverse.
apply (strictly_order_reflecting (y *.)).
rewrite (commutativity x), simple_associativity, dec_recip_inverse.
rewrite mult_1_l,mult_1_r.
apply lt_ne_flip;trivial.
Lemma flip_lt_dec_recip_l x y : 0 < y -> /y < x -> /x < y.
rewrite <-(dec_recip_involutive y).
apply flip_lt_dec_recip; trivial.
apply pos_dec_recip_compat.
Lemma flip_lt_dec_recip_r x y : 0 < y -> y < /x -> x < /y.
rewrite <-(dec_recip_involutive x).
apply flip_lt_dec_recip;trivial.
#[export]
Hint Extern 12 (PropHolds (0 ≤ _)) =>
eapply @nonneg_dec_recip_compat : typeclass_instances.
#[export]
Hint Extern 12 (PropHolds (0 < _)) =>
eapply @pos_dec_recip_compat : typeclass_instances.