Floors and ceils aren't preserved under ordered ring homomorphisms #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Intuitively, if f : α → β
is an ordered ring homomorphism, then floors and ceils should be
preserved by f
because:
f
preserves the naturals/integers inα
andβ
because it's a ring hom.f
preserves what's betweenn
andn + 1
because it's monotone.
However, there is a catch. Potentially something whose floor was n
could
get mapped to n + 1
, and this has floor n + 1
, not n
. Note that this is at most an off by one
error.
This pathology disappears if you require f
to be strictly monotone or α
to be archimedean.
The counterexample #
Consider ℤ[ε]
(int_with_epsilons
), the integers with infinitesimals adjoined. This is a linearly
ordered commutative floor ring (int_with_epsilons.linear_ordered_comm_ring
,
int_with_epsilons.floor_ring
).
The map f : ℤ[ε] → ℤ
that forgets about the epsilons (int_with_epsilons.forget_epsilons
) is an
ordered ring homomorphism.
But it does not preserve floors (nor ceils) as ⌊-ε⌋ = -1
while ⌊f (-ε)⌋ = ⌊0⌋ = 0
(int_with_epsilons.forget_epsilons_floor_lt
, int_with_epsilons.lt_forget_epsilons_ceil
).
The integers with infinitesimals adjoined.
Equations
Instances for counterexample.int_with_epsilon
- counterexample.int_with_epsilon.comm_ring
- counterexample.int_with_epsilon.nontrivial
- counterexample.int_with_epsilon.inhabited
- counterexample.int_with_epsilon.linear_order
- counterexample.int_with_epsilon.ordered_add_comm_group
- counterexample.int_with_epsilon.linear_ordered_comm_ring
- counterexample.int_with_epsilon.floor_ring
Equations
- counterexample.int_with_epsilon.ordered_add_comm_group = function.injective.ordered_add_comm_group (⇑to_lex ∘ polynomial.coeff) counterexample.int_with_epsilon.ordered_add_comm_group._proof_1 counterexample.int_with_epsilon.ordered_add_comm_group._proof_2 counterexample.int_with_epsilon.ordered_add_comm_group._proof_3 counterexample.int_with_epsilon.ordered_add_comm_group._proof_4 counterexample.int_with_epsilon.ordered_add_comm_group._proof_5 counterexample.int_with_epsilon.ordered_add_comm_group._proof_6 counterexample.int_with_epsilon.ordered_add_comm_group._proof_7
Equations
- counterexample.int_with_epsilon.linear_ordered_comm_ring = {add := comm_ring.add counterexample.int_with_epsilon.comm_ring, add_assoc := _, zero := comm_ring.zero counterexample.int_with_epsilon.comm_ring, zero_add := _, add_zero := _, nsmul := comm_ring.nsmul counterexample.int_with_epsilon.comm_ring, nsmul_zero' := _, nsmul_succ' := _, neg := comm_ring.neg counterexample.int_with_epsilon.comm_ring, sub := comm_ring.sub counterexample.int_with_epsilon.comm_ring, sub_eq_add_neg := _, zsmul := comm_ring.zsmul counterexample.int_with_epsilon.comm_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := comm_ring.int_cast counterexample.int_with_epsilon.comm_ring, nat_cast := comm_ring.nat_cast counterexample.int_with_epsilon.comm_ring, one := comm_ring.one counterexample.int_with_epsilon.comm_ring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := comm_ring.mul counterexample.int_with_epsilon.comm_ring, mul_assoc := _, one_mul := _, mul_one := _, npow := comm_ring.npow counterexample.int_with_epsilon.comm_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := linear_order.le counterexample.int_with_epsilon.linear_order, lt := linear_order.lt counterexample.int_with_epsilon.linear_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, exists_pair_ne := _, zero_le_one := counterexample.int_with_epsilon.linear_ordered_comm_ring._proof_1, mul_pos := counterexample.int_with_epsilon.linear_ordered_comm_ring._proof_2, le_total := _, decidable_le := linear_order.decidable_le counterexample.int_with_epsilon.linear_order, decidable_eq := linear_order.decidable_eq counterexample.int_with_epsilon.linear_order, decidable_lt := linear_order.decidable_lt counterexample.int_with_epsilon.linear_order, max := linear_order.max counterexample.int_with_epsilon.linear_order, max_def := _, min := linear_order.min counterexample.int_with_epsilon.linear_order, min_def := _, mul_comm := _}
Equations
- counterexample.int_with_epsilon.floor_ring = floor_ring.of_floor counterexample.int_with_epsilon (λ (p : counterexample.int_with_epsilon), ite (↑(polynomial.coeff p 0) ≤ p) (polynomial.coeff p 0) (polynomial.coeff p 0 - 1)) counterexample.int_with_epsilon.floor_ring._proof_1
The ordered ring homomorphisms from ℤ[ε]
to ℤ
that "forgets" the ε
s.
Equations
- counterexample.int_with_epsilon.forget_epsilons = {to_ring_hom := {to_fun := λ (p : counterexample.int_with_epsilon), polynomial.coeff p 0, map_one' := _, map_mul' := _, map_zero' := counterexample.int_with_epsilon.forget_epsilons._proof_1, map_add' := counterexample.int_with_epsilon.forget_epsilons._proof_2}, monotone' := counterexample.int_with_epsilon.forget_epsilons._proof_3}
The floor of n - ε
is n - 1
but its image under forget_epsilons
is n
, whose floor is
itself.
The ceil of n + ε
is n + 1
but its image under forget_epsilons
is n
, whose ceil is
itself.