Commit 2023-05-01 23:12 b2d7b50d
View on Github →chore(algebra/order/to_interval_mod): Reorder arguments (#18908)
The current argument order to to_Ixx_mod is a bit poor: In to_Ico a hb x, a and x play a similar role while b is completely separate. This PR changes this to to_Ico hp a b, where the translation is as follows:
mem_Ioo_mod a p b→mem_Ioo_mod p a b(this is more consistent withint.modeq p a b)to_Ico_div a hp b→to_Ico_div hp a bto_Ioc_div a hp b→to_Ioc_div hp a bto_Ico_mod a hp b→to_Ico_mod hp a bto_Ioc_mod a hp b→to_Ioc_mod hp a bWhile it might be tempting to orderto_Ico_div hp a basto_Ico_div b a hpto match the order of the morally equivalent(b - a) / p + a, we opt for the simpler convention of being consistent withmem_Ioo_mod, as in downstream files we also find it convenient to havebas the last argument. Generally speaking, the variables have been renamed toa→a(the left end)b→p(the period)x→b(the interval length)y→c(additional argument similar to the left end and interval length)z→n(the euclidean dividend) Proofs are golfed slightly. The only lemma statements that changed areto_Ico_div_eq_of_sub_zsmul_mem_Ico/to_Ioc_div_eq_of_sub_zsmul_mem_Iocthat now stateto_Ico_div hp a b = nrather thann = to_Ico_div hp a b(they were always used in this new direction).