Reducing to an interval modulo its length #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines operations that reduce a number (in an archimedean
linear_ordered_add_comm_group
) to a number in a given interval, modulo the length of that
interval.
Main definitions #
to_Ico_div hp a b
(wherehp : 0 < p
): The unique integer such that this multiple ofp
, subtracted fromb
, is inIco a (a + p)
.to_Ico_mod hp a b
(wherehp : 0 < p
): Reduceb
to the intervalIco a (a + p)
.to_Ioc_div hp a b
(wherehp : 0 < p
): The unique integer such that this multiple ofp
, subtracted fromb
, is inIoc a (a + p)
.to_Ioc_mod hp a b
(wherehp : 0 < p
): Reduceb
to the intervalIoc a (a + p)
.
The unique integer such that this multiple of p
, subtracted from b
, is in Ico a (a + p)
.
Equations
- to_Ico_div hp a b = Exists.some _
The unique integer such that this multiple of p
, subtracted from b
, is in Ioc a (a + p)
.
Equations
- to_Ioc_div hp a b = Exists.some _
Reduce b
to the interval Ico a (a + p)
.
Equations
- to_Ico_mod hp a b = b - to_Ico_div hp a b • p
Reduce b
to the interval Ioc a (a + p)
.
Equations
- to_Ioc_mod hp a b = b - to_Ioc_div hp a b • p
Note we omit to_Ico_div_zsmul_add'
as -m + to_Ico_div hp a b
is not very convenient.
Note we omit to_Ioc_div_zsmul_add'
as -m + to_Ioc_div hp a b
is not very convenient.
Links between the Ico
and Ioc
variants applied to the same element #
Alias of the forward direction of add_comm_group.modeq_iff_to_Ico_mod_eq_left
.
Alias of the forward direction of add_comm_group.modeq_iff_to_Ioc_mod_eq_right
.
If a
and b
fall within the same cycle WRT c
, then they are congruent modulo p
.
Alias of the reverse direction of to_Ico_mod_inj
.
to_Ico_mod
as an equiv from the quotient.
Equations
- quotient_add_group.equiv_Ico_mod hp a = {to_fun := λ (b : α ⧸ add_subgroup.zmultiples p), ⟨_.lift b, _⟩, inv_fun := coe coe_to_lift, left_inv := _, right_inv := _}
to_Ioc_mod
as an equiv from the quotient.
Equations
- quotient_add_group.equiv_Ioc_mod hp a = {to_fun := λ (b : α ⧸ add_subgroup.zmultiples p), ⟨_.lift b, _⟩, inv_fun := coe coe_to_lift, left_inv := _, right_inv := _}
The circular order structure on α ⧸ add_subgroup.zmultiples p
#
Equations
- quotient_add_group.has_quotient.quotient.has_btw = {btw := λ (x₁ x₂ x₃ : α ⧸ add_subgroup.zmultiples p), ↑(⇑(quotient_add_group.equiv_Ico_mod quotient_add_group.has_quotient.quotient.has_btw._proof_1 0) (x₂ - x₁)) ≤ ↑(⇑(quotient_add_group.equiv_Ioc_mod quotient_add_group.has_quotient.quotient.has_btw._proof_3 0) (x₃ - x₁))}
Equations
- quotient_add_group.circular_preorder = {to_has_btw := quotient_add_group.has_quotient.quotient.has_btw hp', to_has_sbtw := {sbtw := λ (_x _x_1 _x_2 : α ⧸ add_subgroup.zmultiples p), has_btw.btw _x _x_1 _x_2 ∧ ¬has_btw.btw _x_2 _x_1 _x}, btw_refl := _, btw_cyclic_left := _, sbtw_iff_btw_not_btw := _, sbtw_trans_left := _}
Equations
- quotient_add_group.circular_order = {to_circular_partial_order := {to_circular_preorder := {to_has_btw := circular_preorder.to_has_btw quotient_add_group.circular_preorder, to_has_sbtw := circular_preorder.to_has_sbtw quotient_add_group.circular_preorder, btw_refl := _, btw_cyclic_left := _, sbtw_iff_btw_not_btw := _, sbtw_trans_left := _}, btw_antisymm := _}, btw_total := _}