proposition: Lemma dy_eq_dec_aux (x y : Dyadic) p : mant x = mant y ≪ (expo y - expo x)↾p ↔ x = y.
proof: Proof. destruct x as [xm xe], y as [ym ye]. assert (xe ≤ ye). now apply rings.flip_nonneg_minus. split; intros E. unfold equiv, dy_equiv, DtoQ_slow. simpl in *. rewrite E, ZtoQ_shift. rewrite <-associativity, <-int_pow_exp_plus. now setoid_replace (ye - xe + xe) with ye by ring. easy. unfold equiv, dy_equiv, DtoQ_slow in E. simpl in *. apply (injective ZtoStdQ). apply (right_cancellation (.*.) (2 ^ xe)). rewrite E, ZtoQ_shift. rewrite <-associativity, <-int_pow_exp_plus. now setoid_replace (ye - xe + xe) with ye by ring. easy. Qed.
imports: Coq.setoid_ring.Ring MathClasses.interfaces.abstract_algebra MathClasses.interfaces.integers MathClasses.interfaces.naturals MathClasses.interfaces.rationals MathClasses.interfaces.additional_operations MathClasses.interfaces.orders MathClasses.orders.minmax MathClasses.orders.integers MathClasses.orders.rationals MathClasses.implementations.nonneg_integers_naturals MathClasses.implementations.stdlib_rationals MathClasses.theory.rationals MathClasses.theory.shiftl MathClasses.theory.int_pow MathClasses.theory.nat_pow MathClasses.theory.abs