doc-next-gen

Mathlib.Algebra.Order.Archimedean.Basic

Module docstring

{"# Archimedean groups and fields.

This file defines the archimedean property for ordered groups and proves several results connected to this notion. Being archimedean means that for all elements x and y>0 there exists a natural number n such that x ≤ n • y.

Main definitions

  • Archimedean is a typeclass for an ordered additive commutative monoid to have the archimedean property.
  • MulArchimedean is a typeclass for an ordered commutative monoid to have the \"mul-archimedean property\" where for x and y > 1, there exists a natural number n such that x ≤ y ^ n.
  • Archimedean.floorRing defines a floor function on an archimedean linearly ordered ring making it into a floorRing.

Main statements

  • , , and are archimedean. "}
Archimedean structure
(M) [AddCommMonoid M] [PartialOrder M]
Full source
/-- An ordered additive commutative monoid is called `Archimedean` if for any two elements `x`, `y`
such that `0 < y`, there exists a natural number `n` such that `x ≤ n • y`. -/
class Archimedean (M) [AddCommMonoid M] [PartialOrder M] : Prop where
  /-- For any two elements `x`, `y` such that `0 < y`, there exists a natural number `n`
  such that `x ≤ n • y`. -/
  arch : ∀ (x : M) {y : M}, 0 < y → ∃ n : ℕ, x ≤ n • y
Archimedean property for ordered additive commutative monoids
Informal description
An ordered additive commutative monoid $M$ is called *Archimedean* if for any two elements $x, y \in M$ with $0 < y$, there exists a natural number $n$ such that $x \leq n \cdot y$.
MulArchimedean structure
(M) [CommMonoid M] [PartialOrder M]
Full source
/-- An ordered commutative monoid is called `MulArchimedean` if for any two elements `x`, `y`
such that `1 < y`, there exists a natural number `n` such that `x ≤ y ^ n`. -/
@[to_additive Archimedean]
class MulArchimedean (M) [CommMonoid M] [PartialOrder M] : Prop where
  /-- For any two elements `x`, `y` such that `1 < y`, there exists a natural number `n`
  such that `x ≤ y ^ n`. -/
  arch : ∀ (x : M) {y : M}, 1 < y → ∃ n : ℕ, x ≤ y ^ n
Multiplicatively Archimedean Monoid
Informal description
An ordered commutative monoid $M$ is called *multiplicatively Archimedean* if for any two elements $x, y \in M$ with $1 < y$, there exists a natural number $n$ such that $x \leq y^n$.
OrderDual.instMulArchimedean instance
[CommGroup G] [PartialOrder G] [IsOrderedMonoid G] [MulArchimedean G] : MulArchimedean Gᵒᵈ
Full source
@[to_additive]
instance OrderDual.instMulArchimedean [CommGroup G] [PartialOrder G] [IsOrderedMonoid G]
    [MulArchimedean G] :
    MulArchimedean Gᵒᵈ :=
  ⟨fun x y hy =>
    let ⟨n, hn⟩ := MulArchimedean.arch (ofDual x)⁻¹ (inv_lt_one_iff_one_lt.2 hy)
    ⟨n, by rwa [inv_pow, inv_le_inv_iff] at hn⟩⟩
Order Dual of a Multiplicatively Archimedean Group is Multiplicatively Archimedean
Informal description
For any commutative group $G$ with a partial order that makes it an ordered monoid, if $G$ is multiplicatively Archimedean, then its order dual $G^{\text{op}}$ is also multiplicatively Archimedean.
Additive.instArchimedean instance
[CommGroup G] [PartialOrder G] [MulArchimedean G] : Archimedean (Additive G)
Full source
instance Additive.instArchimedean [CommGroup G] [PartialOrder G] [MulArchimedean G] :
    Archimedean (Additive G) :=
  ⟨fun x _ hy ↦ MulArchimedean.arch x.toMul hy⟩
Additive Version of a Multiplicatively Archimedean Group is Archimedean
Informal description
For any commutative group $G$ with a partial order that makes it an ordered monoid, if $G$ is multiplicatively Archimedean, then its additive counterpart $\text{Additive } G$ is Archimedean.
Multiplicative.instMulArchimedean instance
[AddCommGroup G] [PartialOrder G] [Archimedean G] : MulArchimedean (Multiplicative G)
Full source
instance Multiplicative.instMulArchimedean [AddCommGroup G] [PartialOrder G] [Archimedean G] :
    MulArchimedean (Multiplicative G) :=
  ⟨fun x _ hy ↦ Archimedean.arch x.toAdd hy⟩
Multiplicative Version of an Archimedean Group is Multiplicatively Archimedean
Informal description
For any additive commutative group $G$ with a partial order that is Archimedean, the multiplicative counterpart $\text{Multiplicative } G$ is multiplicatively Archimedean.
exists_lt_pow theorem
[CommMonoid M] [PartialOrder M] [MulArchimedean M] [MulLeftStrictMono M] {a : M} (ha : 1 < a) (b : M) : ∃ n : ℕ, b < a ^ n
Full source
@[to_additive]
theorem exists_lt_pow [CommMonoid M] [PartialOrder M] [MulArchimedean M] [MulLeftStrictMono M]
    {a : M} (ha : 1 < a) (b : M) : ∃ n : ℕ, b < a ^ n :=
  let ⟨k, hk⟩ := MulArchimedean.arch b ha
  ⟨k + 1, hk.trans_lt <| pow_lt_pow_right' ha k.lt_succ_self⟩
Existence of Dominating Power in Multiplicatively Archimedean Monoids
Informal description
Let $M$ be a partially ordered commutative monoid that is multiplicatively Archimedean and has strictly increasing multiplication on the left. For any element $a \in M$ with $1 < a$ and any element $b \in M$, there exists a natural number $n$ such that $b < a^n$.
existsUnique_zpow_near_of_one_lt theorem
{a : G} (ha : 1 < a) (g : G) : ∃! k : ℤ, a ^ k ≤ g ∧ g < a ^ (k + 1)
Full source
/-- An archimedean decidable linearly ordered `CommGroup` has a version of the floor: for
`a > 1`, any `g` in the group lies between some two consecutive powers of `a`. -/
@[to_additive "An archimedean decidable linearly ordered `AddCommGroup` has a version of the floor:
for `a > 0`, any `g` in the group lies between some two consecutive multiples of `a`. -/"]
theorem existsUnique_zpow_near_of_one_lt {a : G} (ha : 1 < a) (g : G) :
    ∃! k : ℤ, a ^ k ≤ g ∧ g < a ^ (k + 1) := by
  let s : Set  := { n : ℤ | a ^ n ≤ g }
  obtain ⟨k, hk : g⁻¹ ≤ a ^ k⟩ := MulArchimedean.arch g⁻¹ ha
  have h_ne : s.Nonempty := ⟨-k, by simpa [s] using inv_le_inv' hk⟩
  obtain ⟨k, hk⟩ := MulArchimedean.arch g ha
  have h_bdd : ∀ n ∈ s, n ≤ (k : ℤ) := by
    intro n hn
    apply (zpow_le_zpow_iff_right ha).mp
    rw [← zpow_natCast] at hk
    exact le_trans hn hk
  obtain ⟨m, hm, hm'⟩ := Int.exists_greatest_of_bdd ⟨k, h_bdd⟩ h_ne
  have hm'' : g < a ^ (m + 1) := by
    contrapose! hm'
    exact ⟨m + 1, hm', lt_add_one _⟩
  refine ⟨m, ⟨hm, hm''⟩, fun n hn => (hm' n hn.1).antisymm <| Int.le_of_lt_add_one ?_⟩
  rw [← zpow_lt_zpow_iff_right ha]
  exact lt_of_le_of_lt hm hn.2
Unique Integer Power Bounding in Ordered Commutative Groups: $a^k \leq g < a^{k+1}$
Informal description
Let $G$ be a linearly ordered commutative group. For any element $a \in G$ with $a > 1$ and any element $g \in G$, there exists a unique integer $k$ such that $a^k \leq g < a^{k+1}$.
existsUnique_zpow_near_of_one_lt' theorem
{a : G} (ha : 1 < a) (g : G) : ∃! k : ℤ, 1 ≤ g / a ^ k ∧ g / a ^ k < a
Full source
@[to_additive]
theorem existsUnique_zpow_near_of_one_lt' {a : G} (ha : 1 < a) (g : G) :
    ∃! k : ℤ, 1 ≤ g / a ^ k ∧ g / a ^ k < a := by
  simpa only [one_le_div', zpow_add_one, div_lt_iff_lt_mul'] using
    existsUnique_zpow_near_of_one_lt ha g
Unique Integer Power Scaling Bounds: $1 \leq g / a^k < a$
Informal description
Let $G$ be a linearly ordered commutative group. For any element $a \in G$ with $a > 1$ and any element $g \in G$, there exists a unique integer $k$ such that $1 \leq g / a^k < a$.
existsUnique_div_zpow_mem_Ico theorem
{a : G} (ha : 1 < a) (b c : G) : ∃! m : ℤ, b / a ^ m ∈ Set.Ico c (c * a)
Full source
@[to_additive]
theorem existsUnique_div_zpow_mem_Ico {a : G} (ha : 1 < a) (b c : G) :
    ∃! m : ℤ, b / a ^ m ∈ Set.Ico c (c * a) := by
  simpa only [mem_Ico, le_div_iff_mul_le, one_mul, mul_comm c, div_lt_iff_lt_mul, mul_assoc] using
    existsUnique_zpow_near_of_one_lt' ha (b / c)
Unique Integer Exponent for Scaled Group Element in Interval: $b / a^m \in [c, c \cdot a)$
Informal description
Let $G$ be a linearly ordered commutative group. For any elements $a, b, c \in G$ with $a > 1$, there exists a unique integer $m$ such that $b / a^m$ belongs to the interval $[c, c \cdot a)$.
existsUnique_mul_zpow_mem_Ico theorem
{a : G} (ha : 1 < a) (b c : G) : ∃! m : ℤ, b * a ^ m ∈ Set.Ico c (c * a)
Full source
@[to_additive]
theorem existsUnique_mul_zpow_mem_Ico {a : G} (ha : 1 < a) (b c : G) :
    ∃! m : ℤ, b * a ^ m ∈ Set.Ico c (c * a) :=
  (Equiv.neg ).bijective.existsUnique_iff.2 <| by
    simpa only [Equiv.neg_apply, mem_Ico, zpow_neg, ← div_eq_mul_inv, le_div_iff_mul_le, one_mul,
      mul_comm c, div_lt_iff_lt_mul, mul_assoc] using existsUnique_zpow_near_of_one_lt' ha (b / c)
Unique Integer Exponent for Group Element in Interval: $b \cdot a^m \in [c, c \cdot a)$
Informal description
Let $G$ be a linearly ordered commutative group. For any elements $a, b, c \in G$ with $a > 1$, there exists a unique integer $m$ such that $b \cdot a^m$ belongs to the interval $[c, c \cdot a)$.
existsUnique_add_zpow_mem_Ioc theorem
{a : G} (ha : 1 < a) (b c : G) : ∃! m : ℤ, b * a ^ m ∈ Set.Ioc c (c * a)
Full source
@[to_additive]
theorem existsUnique_add_zpow_mem_Ioc {a : G} (ha : 1 < a) (b c : G) :
    ∃! m : ℤ, b * a ^ m ∈ Set.Ioc c (c * a) :=
  (Equiv.addRight (1 : )).bijective.existsUnique_iff.2 <| by
    simpa only [zpow_add_one, div_lt_iff_lt_mul', le_div_iff_mul_le', ← mul_assoc, and_comm,
      mem_Ioc, Equiv.coe_addRight, mul_le_mul_iff_right] using
      existsUnique_zpow_near_of_one_lt ha (c / b)
Unique Integer Exponent for Group Element in Interval: $b \cdot a^m \in (c, c \cdot a]$
Informal description
Let $G$ be a linearly ordered commutative group. For any elements $a, b, c \in G$ with $a > 1$, there exists a unique integer $m$ such that $b \cdot a^m$ belongs to the interval $(c, c \cdot a]$.
existsUnique_sub_zpow_mem_Ioc theorem
{a : G} (ha : 1 < a) (b c : G) : ∃! m : ℤ, b / a ^ m ∈ Set.Ioc c (c * a)
Full source
@[to_additive]
theorem existsUnique_sub_zpow_mem_Ioc {a : G} (ha : 1 < a) (b c : G) :
    ∃! m : ℤ, b / a ^ m ∈ Set.Ioc c (c * a) :=
  (Equiv.neg ).bijective.existsUnique_iff.2 <| by
    simpa only [Equiv.neg_apply, zpow_neg, div_inv_eq_mul] using
      existsUnique_add_zpow_mem_Ioc ha b c
Unique Integer Exponent for Quotient in Interval: $b / a^m \in (c, c \cdot a]$
Informal description
Let $G$ be a linearly ordered commutative group. For any elements $a, b, c \in G$ with $a > 1$, there exists a unique integer $m$ such that $b / a^m$ belongs to the interval $(c, c \cdot a]$.
exists_nat_ge theorem
(x : R) : ∃ n : ℕ, x ≤ n
Full source
theorem exists_nat_ge (x : R) :
    ∃ n : ℕ, x ≤ n := by
  nontriviality R
  exact (Archimedean.arch x one_pos).imp fun n h => by rwa [← nsmul_one]
Existence of Natural Upper Bound in Archimedean Rings
Informal description
For any element $x$ in an Archimedean ordered ring $R$, there exists a natural number $n$ such that $x \leq n$.
instIsDirectedLe instance
: IsDirected R (· ≤ ·)
Full source
instance (priority := 100) : IsDirected R (· ≤ ·) :=
  ⟨fun x y ↦
    let ⟨m, hm⟩ := exists_nat_ge x; let ⟨n, hn⟩ := exists_nat_ge y
    let ⟨k, hmk, hnk⟩ := exists_ge_ge m n
    ⟨k, hm.trans <| Nat.mono_cast hmk, hn.trans <| Nat.mono_cast hnk⟩⟩
Directedness of $\leq$ in Archimedean Ordered Rings
Informal description
For any Archimedean ordered ring $R$, the relation $\leq$ on $R$ is directed. That is, for any two elements $x, y \in R$, there exists an element $z \in R$ such that $x \leq z$ and $y \leq z$.
exists_nat_gt theorem
(x : R) : ∃ n : ℕ, x < n
Full source
lemma exists_nat_gt (x : R) : ∃ n : ℕ, x < n :=
  (exists_lt_nsmul zero_lt_one x).imp fun n hn ↦ by rwa [← nsmul_one]
Existence of Strict Natural Upper Bound in Archimedean Rings
Informal description
For any element $x$ in an Archimedean ordered ring $R$, there exists a natural number $n$ such that $x < n$.
add_one_pow_unbounded_of_pos theorem
(x : R) (hy : 0 < y) : ∃ n : ℕ, x < (y + 1) ^ n
Full source
theorem add_one_pow_unbounded_of_pos (x : R) (hy : 0 < y) : ∃ n : ℕ, x < (y + 1) ^ n :=
  have : 0 ≤ 1 + y := add_nonneg zero_le_one hy.le
  (Archimedean.arch x hy).imp fun n h ↦
    calc
      x ≤ n • y := h
      _ = n * y := nsmul_eq_mul _ _
      _ < 1 + n * y := lt_one_add _
      _ ≤ (1 + y) ^ n :=
        one_add_mul_le_pow' (mul_nonneg hy.le hy.le) (mul_nonneg this this)
          (add_nonneg zero_le_two hy.le) _
      _ = (y + 1) ^ n := by rw [add_comm]
Unboundedness of $(y+1)^n$ for $y > 0$ in strict ordered semirings
Informal description
For any element $x$ in a strict ordered semiring $R$ and any positive element $y > 0$ in $R$, there exists a natural number $n$ such that $x < (y + 1)^n$.
pow_unbounded_of_one_lt theorem
[ExistsAddOfLE R] (x : R) (hy1 : 1 < y) : ∃ n : ℕ, x < y ^ n
Full source
lemma pow_unbounded_of_one_lt [ExistsAddOfLE R] (x : R) (hy1 : 1 < y) : ∃ n : ℕ, x < y ^ n := by
  obtain ⟨z, hz, rfl⟩ := exists_pos_add_of_lt' hy1
  rw [add_comm]
  exact add_one_pow_unbounded_of_pos _ hz
Unboundedness of powers $y^n$ for $y > 1$ in strict ordered semirings
Informal description
For any element $x$ in a strict ordered semiring $R$ and any element $y > 1$ in $R$, there exists a natural number $n$ such that $x < y^n$.
exists_int_ge theorem
(x : R) : ∃ n : ℤ, x ≤ n
Full source
theorem exists_int_ge (x : R) : ∃ n : ℤ, x ≤ n := let ⟨n, h⟩ := exists_nat_ge x; ⟨n, mod_cast h⟩
Existence of Integer Upper Bound in Archimedean Rings
Informal description
For any element $x$ in an Archimedean ordered ring $R$, there exists an integer $n$ such that $x \leq n$.
instIsDirectedGe instance
: IsDirected R (· ≥ ·)
Full source
instance (priority := 100) : IsDirected R (· ≥ ·) where
  directed a b :=
    let ⟨m, hm⟩ := exists_int_le a; let ⟨n, hn⟩ := exists_int_le b
    ⟨(min m n : ℤ), le_trans (Int.cast_mono <| min_le_left _ _) hm,
      le_trans (Int.cast_mono <| min_le_right _ _) hn⟩
Directedness of $\geq$ in Archimedean Ordered Rings
Informal description
For any Archimedean ordered ring $R$, the relation $\geq$ is directed. That is, for any two elements $x, y \in R$, there exists an element $z \in R$ such that $z \leq x$ and $z \leq y$.
exists_floor theorem
(x : R) : ∃ fl : ℤ, ∀ z : ℤ, z ≤ fl ↔ (z : R) ≤ x
Full source
theorem exists_floor (x : R) : ∃ fl : ℤ, ∀ z : ℤ, z ≤ fl ↔ (z : R) ≤ x := by
  classical
  have : ∃ ub : ℤ, (ub : R) ≤ x ∧ ∀ z : ℤ, (z : R) ≤ x → z ≤ ub :=
    Int.exists_greatest_of_bdd
      (let ⟨n, hn⟩ := exists_int_gt x
      ⟨n, fun z h' => Int.cast_le.1 <| le_trans h' <| le_of_lt hn⟩)
      (let ⟨n, hn⟩ := exists_int_lt x
      ⟨n, le_of_lt hn⟩)
  refine this.imp fun fl h z => ?_
  obtain ⟨h₁, h₂⟩ := h
  exact ⟨fun h => le_trans (Int.cast_le.2 h) h₁, h₂ z⟩
Existence of Floor Function in Archimedean Rings: $z \leq \text{fl} \leftrightarrow z \leq x$
Informal description
For any element $x$ in an Archimedean ordered ring $R$, there exists an integer $\text{fl}$ such that for all integers $z$, $z \leq \text{fl}$ if and only if $z \leq x$ in $R$.
exists_nat_pow_near theorem
(hx : 1 ≤ x) (hy : 1 < y) : ∃ n : ℕ, y ^ n ≤ x ∧ x < y ^ (n + 1)
Full source
/-- Every x greater than or equal to 1 is between two successive
natural-number powers of every y greater than one. -/
theorem exists_nat_pow_near (hx : 1 ≤ x) (hy : 1 < y) : ∃ n : ℕ, y ^ n ≤ x ∧ x < y ^ (n + 1) := by
  have h : ∃ n : ℕ, x < y ^ n := pow_unbounded_of_one_lt _ hy
  classical exact
      let n := Nat.find h
      have hn : x < y ^ n := Nat.find_spec h
      have hnp : 0 < n :=
        pos_iff_ne_zero.2 fun hn0 => by rw [hn0, pow_zero] at hn; exact not_le_of_gt hn hx
      have hnsp : Nat.pred n + 1 = n := Nat.succ_pred_eq_of_pos hnp
      have hltn : Nat.pred n < n := Nat.pred_lt (ne_of_gt hnp)
      ⟨Nat.pred n, le_of_not_lt (Nat.find_min h hltn), by rwa [hnsp]⟩
Bounding Powers: $y^n \leq x < y^{n+1}$ for $x \geq 1$ and $y > 1$
Informal description
For any real number $x \geq 1$ and any real number $y > 1$, there exists a natural number $n$ such that $y^n \leq x < y^{n+1}$.
exists_nat_one_div_lt theorem
(hε : 0 < ε) : ∃ n : ℕ, 1 / (n + 1 : K) < ε
Full source
lemma exists_nat_one_div_lt (hε : 0 < ε) : ∃ n : ℕ, 1 / (n + 1 : K) < ε := by
  obtain ⟨n, hn⟩ := exists_nat_gt (1 / ε)
  use n
  rw [div_lt_iff₀, ← div_lt_iff₀' hε]
  · apply hn.trans
    simp [zero_lt_one]
  · exact n.cast_add_one_pos
Existence of Natural Number with Small Reciprocal: $\frac{1}{n + 1} < \varepsilon$
Informal description
For any positive real number $\varepsilon > 0$ in an Archimedean ordered field $K$, there exists a natural number $n$ such that the reciprocal of $n + 1$ is less than $\varepsilon$, i.e., $\frac{1}{n + 1} < \varepsilon$.
exists_mem_Ico_zpow theorem
(hx : 0 < x) (hy : 1 < y) : ∃ n : ℤ, x ∈ Ico (y ^ n) (y ^ (n + 1))
Full source
/-- Every positive `x` is between two successive integer powers of
another `y` greater than one. This is the same as `exists_mem_Ioc_zpow`,
but with ≤ and < the other way around. -/
theorem exists_mem_Ico_zpow (hx : 0 < x) (hy : 1 < y) : ∃ n : ℤ, x ∈ Ico (y ^ n) (y ^ (n + 1)) := by
  classical
  have he : ∃ m : ℤ, y ^ m ≤ x := by
    obtain ⟨N, hN⟩ := pow_unbounded_of_one_lt x⁻¹ hy
    use -N
    rw [zpow_neg y ↑N, zpow_natCast]
    exact ((inv_lt_comm₀ hx (lt_trans (inv_pos.2 hx) hN)).1 hN).le
  have hb : ∃ b : ℤ, ∀ m, y ^ m ≤ x → m ≤ b := by
    obtain ⟨M, hM⟩ := pow_unbounded_of_one_lt x hy
    refine ⟨M, fun m hm ↦ ?_⟩
    contrapose! hM
    rw [← zpow_natCast]
    exact le_trans (zpow_le_zpow_right₀ hy.le hM.le) hm
  obtain ⟨n, hn₁, hn₂⟩ := Int.exists_greatest_of_bdd hb he
  exact ⟨n, hn₁, lt_of_not_ge fun hge => (Int.lt_succ _).not_le (hn₂ _ hge)⟩
Existence of Integer Power Interval for Positive Elements: $x \in [y^n, y^{n+1})$ for $x > 0$, $y > 1$
Informal description
For any positive element $x$ in an Archimedean ordered additive commutative monoid and any element $y > 1$, there exists an integer $n$ such that $x$ lies in the interval $[y^n, y^{n+1})$.
exists_mem_Ioc_zpow theorem
(hx : 0 < x) (hy : 1 < y) : ∃ n : ℤ, x ∈ Ioc (y ^ n) (y ^ (n + 1))
Full source
/-- Every positive `x` is between two successive integer powers of
another `y` greater than one. This is the same as `exists_mem_Ico_zpow`,
but with ≤ and < the other way around. -/
theorem exists_mem_Ioc_zpow (hx : 0 < x) (hy : 1 < y) : ∃ n : ℤ, x ∈ Ioc (y ^ n) (y ^ (n + 1)) :=
  let ⟨m, hle, hlt⟩ := exists_mem_Ico_zpow (inv_pos.2 hx) hy
  have hyp : 0 < y := lt_trans zero_lt_one hy
  ⟨-(m + 1), by rwa [zpow_neg, inv_lt_comm₀ (zpow_pos hyp _) hx], by
    rwa [neg_add, neg_add_cancel_right, zpow_neg, le_inv_comm₀ hx (zpow_pos hyp _)]⟩
Existence of Integer Power Interval for Positive Elements: $x \in (y^n, y^{n+1}]$ for $x > 0$, $y > 1$
Informal description
For any positive element $x > 0$ in an Archimedean ordered additive commutative monoid and any element $y > 1$, there exists an integer $n$ such that $x$ lies in the interval $(y^n, y^{n+1}]$.
exists_pow_lt_of_lt_one theorem
(hx : 0 < x) (hy : y < 1) : ∃ n : ℕ, y ^ n < x
Full source
/-- For any `y < 1` and any positive `x`, there exists `n : ℕ` with `y ^ n < x`. -/
theorem exists_pow_lt_of_lt_one (hx : 0 < x) (hy : y < 1) : ∃ n : ℕ, y ^ n < x := by
  by_cases y_pos : y ≤ 0
  · use 1
    simp only [pow_one]
    exact y_pos.trans_lt hx
  rw [not_le] at y_pos
  rcases pow_unbounded_of_one_lt x⁻¹ ((one_lt_inv₀ y_pos).2 hy) with ⟨q, hq⟩
  exact ⟨q, by rwa [inv_pow, inv_lt_inv₀ hx (pow_pos y_pos _)] at hq⟩
Existence of Power Below Positive Element for $y < 1$ in Strict Ordered Semirings
Informal description
For any positive element $x > 0$ and any element $y < 1$ in a strict ordered semiring, there exists a natural number $n$ such that $y^n < x$.
exists_nat_pow_near_of_lt_one theorem
(xpos : 0 < x) (hx : x ≤ 1) (ypos : 0 < y) (hy : y < 1) : ∃ n : ℕ, y ^ (n + 1) < x ∧ x ≤ y ^ n
Full source
/-- Given `x` and `y` between `0` and `1`, `x` is between two successive powers of `y`.
This is the same as `exists_nat_pow_near`, but for elements between `0` and `1` -/
theorem exists_nat_pow_near_of_lt_one (xpos : 0 < x) (hx : x ≤ 1) (ypos : 0 < y) (hy : y < 1) :
    ∃ n : ℕ, y ^ (n + 1) < x ∧ x ≤ y ^ n := by
  rcases exists_nat_pow_near (one_le_inv_iff₀.2 ⟨xpos, hx⟩) (one_lt_inv_iff₀.2 ⟨ypos, hy⟩) with
    ⟨n, hn, h'n⟩
  refine ⟨n, ?_, ?_⟩
  · rwa [inv_pow, inv_lt_inv₀ xpos (pow_pos ypos _)] at h'n
  · rwa [inv_pow, inv_le_inv₀ (pow_pos ypos _) xpos] at hn
Bounding Powers for $0 < x \leq 1$ and $0 < y < 1$: $y^{n+1} < x \leq y^n$
Informal description
For any real numbers $x$ and $y$ with $0 < x \leq 1$ and $0 < y < 1$, there exists a natural number $n$ such that $y^{n+1} < x \leq y^n$.
exists_pow_btwn_of_lt_mul theorem
{a b c : K} (h : a < b * c) (hb₀ : 0 < b) (hb₁ : b ≤ 1) (hc₀ : 0 < c) (hc₁ : c < 1) : ∃ n : ℕ, a < c ^ n ∧ c ^ n < b
Full source
/-- If `a < b * c`, `0 < b ≤ 1` and `0 < c < 1`, then there is a power `c ^ n` with `n : ℕ`
strictly between `a` and `b`. -/
lemma exists_pow_btwn_of_lt_mul {a b c : K} (h : a < b * c) (hb₀ : 0 < b) (hb₁ : b ≤ 1)
    (hc₀ : 0 < c) (hc₁ : c < 1) :
    ∃ n : ℕ, a < c ^ n ∧ c ^ n < b := by
  have := exists_pow_lt_of_lt_one hb₀ hc₁
  refine ⟨Nat.find this, h.trans_le ?_, Nat.find_spec this⟩
  by_contra! H
  have hn : Nat.findNat.find this ≠ 0 := by
    intro hf
    simp only [hf, pow_zero] at H
    exact (H.trans <| (mul_lt_of_lt_one_right hb₀ hc₁).trans_le hb₁).false
  rw [(Nat.succ_pred_eq_of_ne_zero hn).symm, pow_succ, mul_lt_mul_right hc₀] at H
  exact Nat.find_min this (Nat.sub_one_lt hn) H
Existence of Power Between Elements in Strict Ordered Semiring: $a < b \cdot c \implies \exists n \in \mathbb{N}, a < c^n < b$
Informal description
Let $K$ be a strict ordered semiring. For any elements $a, b, c \in K$ such that $a < b \cdot c$, $0 < b \leq 1$, and $0 < c < 1$, there exists a natural number $n$ such that $a < c^n$ and $c^n < b$.
exists_zpow_btwn_of_lt_mul theorem
{a b c : K} (h : a < b * c) (hb₀ : 0 < b) (hc₀ : 0 < c) (hc₁ : c < 1) : ∃ n : ℤ, a < c ^ n ∧ c ^ n < b
Full source
/-- If `a < b * c`, `b` is positive and `0 < c < 1`, then there is a power `c ^ n` with `n : ℤ`
strictly between `a` and `b`. -/
lemma exists_zpow_btwn_of_lt_mul {a b c : K} (h : a < b * c) (hb₀ : 0 < b) (hc₀ : 0 < c)
    (hc₁ : c < 1) :
    ∃ n : ℤ, a < c ^ n ∧ c ^ n < b := by
  rcases le_or_lt a 0 with ha | ha
  · obtain ⟨n, hn⟩ := exists_pow_lt_of_lt_one hb₀ hc₁
    exact ⟨n, ha.trans_lt (zpow_pos hc₀ _), mod_cast hn⟩
  · rcases le_or_lt b 1 with hb₁ | hb₁
    · obtain ⟨n, hn⟩ := exists_pow_btwn_of_lt_mul h hb₀ hb₁ hc₀ hc₁
      exact ⟨n, mod_cast hn⟩
    · rcases lt_or_le a 1 with ha₁ | ha₁
      · refine ⟨0, ?_⟩
        rw [zpow_zero]
        exact ⟨ha₁, hb₁⟩
      · have : b⁻¹ < a⁻¹ * c := by rwa [lt_inv_mul_iff₀' ha, inv_mul_lt_iff₀ hb₀]
        obtain ⟨n, hn₁, hn₂⟩ :=
          exists_pow_btwn_of_lt_mul this (inv_pos_of_pos ha) (inv_le_one_of_one_le₀ ha₁) hc₀ hc₁
        refine ⟨-n, ?_, ?_⟩
        · rwa [lt_inv_comm₀ (pow_pos hc₀ n) ha, ← zpow_natCast, ← zpow_neg] at hn₂
        · rwa [inv_lt_comm₀ hb₀ (pow_pos hc₀ n), ← zpow_natCast, ← zpow_neg] at hn₁
Existence of Integer Power Between Elements in Strict Ordered Semiring: $a < b \cdot c \implies \exists n \in \mathbb{Z}, a < c^n < b$
Informal description
Let $K$ be a strict ordered semiring. For any elements $a, b, c \in K$ such that $a < b \cdot c$, $0 < b$, $0 < c < 1$, there exists an integer $n$ such that $a < c^n$ and $c^n < b$.
archimedean_iff_nat_lt theorem
: Archimedean K ↔ ∀ x : K, ∃ n : ℕ, x < n
Full source
theorem archimedean_iff_nat_lt : ArchimedeanArchimedean K ↔ ∀ x : K, ∃ n : ℕ, x < n :=
  ⟨@exists_nat_gt K _ _ _, fun H =>
    ⟨fun x y y0 =>
      (H (x / y)).imp fun n h => le_of_lt <| by rwa [div_lt_iff₀ y0, ← nsmul_eq_mul] at h⟩⟩
Archimedean Property Characterization via Natural Upper Bounds
Informal description
An ordered field $K$ is Archimedean if and only if for every element $x \in K$, there exists a natural number $n$ such that $x < n$.
archimedean_iff_nat_le theorem
: Archimedean K ↔ ∀ x : K, ∃ n : ℕ, x ≤ n
Full source
theorem archimedean_iff_nat_le : ArchimedeanArchimedean K ↔ ∀ x : K, ∃ n : ℕ, x ≤ n :=
  archimedean_iff_nat_lt.trans
    ⟨fun H x => (H x).imp fun _ => le_of_lt, fun H x =>
      let ⟨n, h⟩ := H x
      ⟨n + 1, lt_of_le_of_lt h (Nat.cast_lt.2 (lt_add_one _))⟩⟩
Archimedean Property Characterization via Natural Upper Bounds (Non-Strict Version)
Informal description
An ordered field $K$ is Archimedean if and only if for every element $x \in K$, there exists a natural number $n$ such that $x \leq n$.
archimedean_iff_int_lt theorem
: Archimedean K ↔ ∀ x : K, ∃ n : ℤ, x < n
Full source
theorem archimedean_iff_int_lt : ArchimedeanArchimedean K ↔ ∀ x : K, ∃ n : ℤ, x < n :=
  ⟨@exists_int_gt K _ _ _, by
    rw [archimedean_iff_nat_lt]
    intro h x
    obtain ⟨n, h⟩ := h x
    refine ⟨n.toNat, h.trans_le ?_⟩
    exact mod_cast Int.self_le_toNat _⟩
Archimedean Property Characterization via Integer Upper Bounds
Informal description
An ordered field $K$ is Archimedean if and only if for every element $x \in K$, there exists an integer $n$ such that $x < n$.
archimedean_iff_int_le theorem
: Archimedean K ↔ ∀ x : K, ∃ n : ℤ, x ≤ n
Full source
theorem archimedean_iff_int_le : ArchimedeanArchimedean K ↔ ∀ x : K, ∃ n : ℤ, x ≤ n :=
  archimedean_iff_int_lt.trans
    ⟨fun H x => (H x).imp fun _ => le_of_lt, fun H x =>
      let ⟨n, h⟩ := H x
      ⟨n + 1, lt_of_le_of_lt h (Int.cast_lt.2 (lt_add_one _))⟩⟩
Archimedean Property Characterization via Integer Upper Bounds (Non-Strict Version)
Informal description
An ordered field $K$ is Archimedean if and only if for every element $x \in K$, there exists an integer $n \in \mathbb{Z}$ such that $x \leq n$.
archimedean_iff_rat_lt theorem
: Archimedean K ↔ ∀ x : K, ∃ q : ℚ, x < q
Full source
theorem archimedean_iff_rat_lt : ArchimedeanArchimedean K ↔ ∀ x : K, ∃ q : ℚ, x < q where
  mp _ x :=
    let ⟨n, h⟩ := exists_nat_gt x
    ⟨n, by rwa [Rat.cast_natCast]⟩
  mpr H := archimedean_iff_nat_lt.2 fun x ↦
    let ⟨q, h⟩ := H x; ⟨⌈q⌉₊, lt_of_lt_of_le h <| mod_cast Nat.le_ceil _⟩
Archimedean Property Characterization via Rational Upper Bounds
Informal description
An ordered field $K$ is Archimedean if and only if for every element $x \in K$, there exists a rational number $q \in \mathbb{Q}$ such that $x < q$.
archimedean_iff_rat_le theorem
: Archimedean K ↔ ∀ x : K, ∃ q : ℚ, x ≤ q
Full source
theorem archimedean_iff_rat_le : ArchimedeanArchimedean K ↔ ∀ x : K, ∃ q : ℚ, x ≤ q :=
  archimedean_iff_rat_lt.trans
    ⟨fun H x => (H x).imp fun _ => le_of_lt, fun H x =>
      let ⟨n, h⟩ := H x
      ⟨n + 1, lt_of_le_of_lt h (Rat.cast_lt.2 (lt_add_one _))⟩⟩
Archimedean Property via Rational Upper Bounds (Non-Strict Version)
Informal description
An ordered field $K$ is Archimedean if and only if for every element $x \in K$, there exists a rational number $q \in \mathbb{Q}$ such that $x \leq q$.
instArchimedeanRat instance
: Archimedean ℚ
Full source
instance : Archimedean ℚ :=
  archimedean_iff_rat_le.2 fun q => ⟨q, by rw [Rat.cast_id]⟩
Archimedean Property of Rational Numbers
Informal description
The rational numbers $\mathbb{Q}$ form an Archimedean ordered additive commutative monoid. That is, for any two rational numbers $x$ and $y > 0$, there exists a natural number $n$ such that $x \leq n \cdot y$.
exists_rat_gt theorem
(x : K) : ∃ q : ℚ, x < q
Full source
theorem exists_rat_gt (x : K) : ∃ q : ℚ, x < q := archimedean_iff_rat_lt.mp ‹_› _
Existence of Rational Upper Bound in Archimedean Fields
Informal description
For any element $x$ in an Archimedean field $K$, there exists a rational number $q \in \mathbb{Q}$ such that $x < q$.
exists_rat_lt theorem
(x : K) : ∃ q : ℚ, (q : K) < x
Full source
theorem exists_rat_lt (x : K) : ∃ q : ℚ, (q : K) < x :=
  let ⟨n, h⟩ := exists_int_lt x
  ⟨n, by rwa [Rat.cast_intCast]⟩
Existence of Rational Lower Bound in Archimedean Fields
Informal description
For any element $x$ in an Archimedean field $K$, there exists a rational number $q$ such that the canonical embedding of $q$ into $K$ is strictly less than $x$, i.e., $q < x$.
exists_rat_btwn theorem
{x y : K} (h : x < y) : ∃ q : ℚ, x < q ∧ (q : K) < y
Full source
theorem exists_rat_btwn {x y : K} (h : x < y) : ∃ q : ℚ, x < q ∧ (q : K) < y := by
  obtain ⟨n, nh⟩ := exists_nat_gt (y - x)⁻¹
  obtain ⟨z, zh⟩ := exists_floor (x * n)
  refine ⟨(z + 1 : ℤ) / n, ?_⟩
  have n0' := (inv_pos.2 (sub_pos.2 h)).trans nh
  have n0 := Nat.cast_pos.1 n0'
  rw [Rat.cast_div_of_ne_zero, Rat.cast_natCast, Rat.cast_intCast, div_lt_iff₀ n0']
  · refine ⟨(lt_div_iff₀ n0').2 <| (lt_iff_lt_of_le_iff_le (zh _)).1 (lt_add_one _), ?_⟩
    rw [Int.cast_add, Int.cast_one]
    refine lt_of_le_of_lt (add_le_add_right ((zh _).1 le_rfl) _) ?_
    rwa [← lt_sub_iff_add_lt', ← sub_mul, ← div_lt_iff₀' (sub_pos.2 h), one_div]
  · rw [Rat.den_intCast, Nat.cast_one]
    exact one_ne_zero
  · intro H
    rw [Rat.num_natCast, Int.cast_natCast, Nat.cast_eq_zero] at H
    subst H
    cases n0
Existence of Rational Number Between Two Elements in an Archimedean Field
Informal description
For any elements $x$ and $y$ in an Archimedean field $K$ with $x < y$, there exists a rational number $q$ such that $x < q$ and the canonical embedding of $q$ into $K$ satisfies $q < y$.
exists_pow_btwn theorem
{n : ℕ} (hn : n ≠ 0) {x y : K} (h : x < y) (hy : 0 < y) : ∃ q : K, 0 < q ∧ x < q ^ n ∧ q ^ n < y
Full source
theorem exists_pow_btwn {n : } (hn : n ≠ 0) {x y : K} (h : x < y) (hy : 0 < y) :
    ∃ q : K, 0 < q ∧ x < q ^ n ∧ q ^ n < y := by
  have ⟨δ, δ_pos, cont⟩ := uniform_continuous_npow_on_bounded (max 1 y)
    (sub_pos.mpr <| max_lt_iff.mpr ⟨h, hy⟩) n
  have ex : ∃ m : ℕ, y ≤ (m * δ) ^ n := by
    have ⟨m, hm⟩ := exists_nat_ge (y / δ + 1 / δ)
    refine ⟨m, le_trans ?_ (le_self_pow₀ ?_ hn)⟩ <;> rw [← div_le_iff₀ δ_pos]
    · exact (lt_add_of_pos_right _ <| by positivity).le.trans hm
    · exact (le_add_of_nonneg_left <| by positivity).trans hm
  let m := Nat.find ex
  have m_pos : 0 < m := (Nat.find_pos _).mpr <| by simpa [zero_pow hn] using hy
  let q := m.pred * δ
  have qny : q ^ n < y := lt_of_not_le (Nat.find_min ex <| Nat.pred_lt m_pos.ne')
  have q1y : |q| < max 1 y := (abs_eq_self.mpr <| by positivity).trans_lt <| lt_max_iff.mpr
    (or_iff_not_imp_left.mpr fun q1 ↦ (le_self_pow₀ (le_of_not_lt q1) hn).trans_lt qny)
  have xqn : max x 0 < q ^ n :=
    calc _ = y - (y - max x 0) := by rw [sub_sub_cancel]
      _ ≤ (m * δ) ^ n - (y - max x 0) := sub_le_sub_right (Nat.find_spec ex) _
      _ < (m * δ) ^ n - ((m * δ) ^ n - q ^ n) := by
        refine sub_lt_sub_left ((le_abs_self _).trans_lt <| cont _ _ q1y.le ?_) _
        rw [← Nat.succ_pred_eq_of_pos m_pos, Nat.cast_succ, ← sub_mul,
          add_sub_cancel_left, one_mul, abs_eq_self.mpr (by positivity)]
      _ = q ^ n := sub_sub_cancel ..
  exact ⟨q, lt_of_le_of_ne (by positivity) fun q0 ↦
    (le_sup_right.trans_lt xqn).ne <| q0 ▸ (zero_pow hn).symm, le_sup_left.trans_lt xqn, qny⟩
Existence of Intermediate $n$-th Power in Archimedean Fields
Informal description
For any nonzero natural number $n$ and any elements $x, y$ in an Archimedean field $K$ with $x < y$ and $0 < y$, there exists an element $q \in K$ such that $0 < q$, $x < q^n$, and $q^n < y$.
exists_rat_pow_btwn theorem
{n : ℕ} (hn : n ≠ 0) {x y : K} (h : x < y) (hy : 0 < y) : ∃ q : ℚ, 0 < q ∧ x < (q : K) ^ n ∧ (q : K) ^ n < y
Full source
/-- There is a rational power between any two positive elements of an archimedean ordered field. -/
theorem exists_rat_pow_btwn {n : } (hn : n ≠ 0) {x y : K} (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : K) ^ n ∧ (q : K) ^ n < y := by
  obtain ⟨q₂, hx₂, hy₂⟩ := exists_rat_btwn (max_lt h hy)
  obtain ⟨q₁, hx₁, hq₁₂⟩ := exists_rat_btwn hx₂
  have : (0 : K) < q₂ := (le_max_right _ _).trans_lt hx₂
  norm_cast at hq₁₂ this
  obtain ⟨q, hq, hq₁, hq₂⟩ := exists_pow_btwn hn hq₁₂ this
  refine ⟨q, hq, (le_max_left _ _).trans_lt <| hx₁.trans ?_, hy₂.trans' ?_⟩ <;> assumption_mod_cast
Existence of Rational Power Between Positive Elements in an Archimedean Field
Informal description
For any nonzero natural number $n$ and any elements $x, y$ in an Archimedean field $K$ with $x < y$ and $0 < y$, there exists a positive rational number $q$ such that $x < q^n$ and $q^n < y$ (where $q^n$ is interpreted in $K$ via the canonical embedding of $\mathbb{Q}$ into $K$).
le_of_forall_rat_lt_imp_le theorem
(h : ∀ q : ℚ, (q : K) < x → (q : K) ≤ y) : x ≤ y
Full source
theorem le_of_forall_rat_lt_imp_le (h : ∀ q : ℚ, (q : K) < x → (q : K) ≤ y) : x ≤ y :=
  le_of_not_lt fun hyx =>
    let ⟨_, hy, hx⟩ := exists_rat_btwn hyx
    hy.not_le <| h _ hx
Archimedean Field Order Criterion via Rational Approximations
Informal description
Let $K$ be an Archimedean field. For $x, y \in K$, if for every rational number $q$ such that $q < x$ implies $q \leq y$, then $x \leq y$.
le_of_forall_lt_rat_imp_le theorem
(h : ∀ q : ℚ, y < q → x ≤ q) : x ≤ y
Full source
theorem le_of_forall_lt_rat_imp_le (h : ∀ q : ℚ, y < q → x ≤ q) : x ≤ y :=
  le_of_not_lt fun hyx =>
    let ⟨_, hy, hx⟩ := exists_rat_btwn hyx
    hx.not_le <| h _ hy
Upper bound characterization via rational numbers in Archimedean fields
Informal description
For elements $x$ and $y$ in an Archimedean field $K$, if for every rational number $q$ such that $y < q$ we have $x \leq q$, then $x \leq y$.
le_iff_forall_rat_lt_imp_le theorem
: x ≤ y ↔ ∀ q : ℚ, (q : K) < x → (q : K) ≤ y
Full source
theorem le_iff_forall_rat_lt_imp_le : x ≤ y ↔ ∀ q : ℚ, (q : K) < x → (q : K) ≤ y :=
  ⟨fun hxy _ hqx ↦ hqx.le.trans hxy, le_of_forall_rat_lt_imp_le⟩
Characterization of Order in Archimedean Fields via Rational Approximations
Informal description
For elements $x$ and $y$ in an Archimedean field $K$, the inequality $x \leq y$ holds if and only if for every rational number $q$, the implication $(q : K) < x \Rightarrow (q : K) \leq y$ holds.
le_iff_forall_lt_rat_imp_le theorem
: x ≤ y ↔ ∀ q : ℚ, y < q → x ≤ q
Full source
theorem le_iff_forall_lt_rat_imp_le : x ≤ y ↔ ∀ q : ℚ, y < q → x ≤ q :=
  ⟨fun hxy _ hqx ↦ hxy.trans hqx.le, le_of_forall_lt_rat_imp_le⟩
Characterization of Inequality via Rational Upper Bounds in Archimedean Fields
Informal description
For elements $x$ and $y$ in an Archimedean field $K$, the inequality $x \leq y$ holds if and only if for every rational number $q$ such that $y < q$, we have $x \leq q$.
exists_pos_rat_lt theorem
{x : K} (x0 : 0 < x) : ∃ q : ℚ, 0 < q ∧ (q : K) < x
Full source
theorem exists_pos_rat_lt {x : K} (x0 : 0 < x) : ∃ q : ℚ, 0 < q ∧ (q : K) < x := by
  simpa only [Rat.cast_pos] using exists_rat_btwn x0
Existence of Positive Rational Less Than Positive Element in Archimedean Field
Informal description
For any positive element $x$ in an Archimedean field $K$, there exists a positive rational number $q$ such that the canonical embedding of $q$ into $K$ satisfies $q < x$.
exists_rat_near theorem
(x : K) (ε0 : 0 < ε) : ∃ q : ℚ, |x - q| < ε
Full source
theorem exists_rat_near (x : K) (ε0 : 0 < ε) : ∃ q : ℚ, |x - q| < ε :=
  let ⟨q, h₁, h₂⟩ :=
    exists_rat_btwn <| ((sub_lt_self_iff x).2 ε0).trans ((lt_add_iff_pos_left x).2 ε0)
  ⟨q, abs_sub_lt_iff.2 ⟨sub_lt_comm.1 h₁, sub_lt_iff_lt_add.2 h₂⟩⟩
Rational Approximation in Archimedean Fields
Informal description
For any element $x$ in an Archimedean field $K$ and any positive real number $\varepsilon > 0$, there exists a rational number $q$ such that the absolute difference between $x$ and $q$ is less than $\varepsilon$, i.e., $|x - q| < \varepsilon$.
instArchimedeanInt instance
: Archimedean ℤ
Full source
instance : Archimedean  :=
  ⟨fun n m m0 =>
    ⟨n.toNat,
      le_trans (Int.self_le_toNat _) <| by
        simpa only [nsmul_eq_mul, zero_add, mul_one] using
          mul_le_mul_of_nonneg_left (Int.add_one_le_iff.2 m0) (Int.ofNat_zero_le n.toNat)⟩⟩
The Archimedean Property of the Integers
Informal description
The integers $\mathbb{Z}$ form an Archimedean ordered additive commutative monoid. That is, for any two integers $x, y \in \mathbb{Z}$ with $0 < y$, there exists a natural number $n$ such that $x \leq n \cdot y$.
Nonneg.instArchimedean instance
[AddCommMonoid M] [PartialOrder M] [IsOrderedAddMonoid M] [Archimedean M] : Archimedean { x : M // 0 ≤ x }
Full source
instance Nonneg.instArchimedean [AddCommMonoid M] [PartialOrder M] [IsOrderedAddMonoid M]
    [Archimedean M] :
    Archimedean { x : M // 0 ≤ x } :=
  ⟨fun x y hy =>
    let ⟨n, hr⟩ := Archimedean.arch (x : M) (hy : (0 : M) < y)
    ⟨n, mod_cast hr⟩⟩
Non-negative Subtype of an Archimedean Monoid is Archimedean
Informal description
For any ordered additive commutative monoid $M$ that is Archimedean, the subtype $\{x \in M \mid 0 \leq x\}$ of non-negative elements is also Archimedean.
Nonneg.instMulArchimedean instance
[CommSemiring R] [PartialOrder R] [IsStrictOrderedRing R] [Archimedean R] [ExistsAddOfLE R] : MulArchimedean { x : R // 0 ≤ x }
Full source
instance Nonneg.instMulArchimedean [CommSemiring R] [PartialOrder R] [IsStrictOrderedRing R]
    [Archimedean R] [ExistsAddOfLE R] :
    MulArchimedean { x : R // 0 ≤ x } :=
  ⟨fun x _ hy ↦ (pow_unbounded_of_one_lt x hy).imp fun _ h ↦ h.le⟩
Non-negative Elements of an Archimedean Strict Ordered Semiring are Multiplicatively Archimedean
Informal description
For any strict ordered semiring $R$ that is Archimedean and satisfies the condition that for any $x \leq y$ there exists $z$ such that $x + z = y$, the non-negative elements $\{x \in R \mid 0 \leq x\}$ form a multiplicatively Archimedean monoid. That is, for any two non-negative elements $x, y \in R$ with $1 < y$, there exists a natural number $n$ such that $x \leq y^n$.
instArchimedeanNNRat instance
: Archimedean NNRat
Full source
instance : Archimedean NNRat := Nonneg.instArchimedean
Archimedean Property of Nonnegative Rational Numbers
Informal description
The nonnegative rational numbers $\mathbb{Q}_{\geq 0}$ form an Archimedean ordered additive commutative monoid. That is, for any two nonnegative rational numbers $x$ and $y > 0$, there exists a natural number $n$ such that $x \leq n \cdot y$.
instMulArchimedeanNNRat instance
: MulArchimedean NNRat
Full source
instance : MulArchimedean NNRat := Nonneg.instMulArchimedean
Multiplicative Archimedean Property of Nonnegative Rational Numbers
Informal description
The nonnegative rational numbers $\mathbb{Q}_{\geq 0}$ form a multiplicatively Archimedean monoid. That is, for any two nonnegative rational numbers $x$ and $y > 1$, there exists a natural number $n$ such that $x \leq y^n$.
Archimedean.floorRing definition
(R) [Ring R] [LinearOrder R] [IsStrictOrderedRing R] [Archimedean R] : FloorRing R
Full source
/-- A linear ordered archimedean ring is a floor ring. This is not an `instance` because in some
cases we have a computable `floor` function. -/
noncomputable def Archimedean.floorRing (R) [Ring R] [LinearOrder R] [IsStrictOrderedRing R]
    [Archimedean R] : FloorRing R :=
  .ofFloor R (fun a => Classical.choose (exists_floor a)) fun z a =>
    (Classical.choose_spec (exists_floor a) z).symm
Floor ring structure on an Archimedean linearly ordered ring
Informal description
Given a linearly ordered ring $R$ that is strict ordered and Archimedean, the structure `FloorRing` is defined on $R$ by constructing a floor function $\lfloor \cdot \rfloor : R \to \mathbb{Z}$ satisfying the Galois connection property: for all integers $z$ and elements $a \in R$, $z \leq \lfloor a \rfloor$ if and only if $z \leq a$ (where $z$ is viewed in $R$ via the canonical embedding). The floor function is constructed using the Archimedean property of $R$.
FloorRing.archimedean instance
(K) [Field K] [LinearOrder K] [IsStrictOrderedRing K] [FloorRing K] : Archimedean K
Full source
/-- A linear ordered field that is a floor ring is archimedean. -/
instance (priority := 100) FloorRing.archimedean (K) [Field K] [LinearOrder K]
    [IsStrictOrderedRing K] [FloorRing K] :
    Archimedean K := by
  rw [archimedean_iff_int_le]
  exact fun x => ⟨⌈x⌉, Int.le_ceil x⟩
Archimedean Property for Linearly Ordered Floor Fields
Informal description
Every linearly ordered field $K$ that is a floor ring is Archimedean. That is, for any two elements $x, y \in K$ with $0 < y$, there exists a natural number $n$ such that $x \leq n \cdot y$.
Units.instMulArchimedean instance
(M) [CommMonoid M] [PartialOrder M] [MulArchimedean M] : MulArchimedean Mˣ
Full source
@[to_additive]
instance Units.instMulArchimedean (M) [CommMonoid M] [PartialOrder M] [MulArchimedean M] :
    MulArchimedean  :=
  ⟨fun x {_} h ↦ MulArchimedean.arch x.val h⟩
Multiplicatively Archimedean Property for Units of a Commutative Monoid
Informal description
For any multiplicatively Archimedean commutative monoid $M$ with a partial order, the group of units $M^\times$ is also multiplicatively Archimedean. That is, for any two elements $x, y \in M^\times$ with $1 < y$, there exists a natural number $n$ such that $x \leq y^n$.
WithBot.instArchimedean instance
(M) [AddCommMonoid M] [PartialOrder M] [Archimedean M] : Archimedean (WithBot M)
Full source
instance WithBot.instArchimedean (M) [AddCommMonoid M] [PartialOrder M] [Archimedean M] :
    Archimedean (WithBot M) := by
  constructor
  intro x y hxy
  cases y with
  | bot => exact absurd hxy bot_le.not_lt
  | coe y =>
    cases x with
    | bot => refine ⟨0, bot_le⟩
    | coe x => simpa [← WithBot.coe_nsmul] using (Archimedean.arch x (by simpa using hxy))
Archimedean Property for $\text{WithBot } M$
Informal description
For any ordered additive commutative monoid $M$ that is Archimedean, the type $\text{WithBot } M$ (which is $M$ with an added bottom element $\bot$) is also Archimedean. This means that for any two elements $x, y \in \text{WithBot } M$ with $0 < y$, there exists a natural number $n$ such that $x \leq n \cdot y$.
WithZero.instMulArchimedean instance
(M) [CommMonoid M] [PartialOrder M] [MulArchimedean M] : MulArchimedean (WithZero M)
Full source
instance WithZero.instMulArchimedean (M) [CommMonoid M] [PartialOrder M] [MulArchimedean M] :
    MulArchimedean (WithZero M) := by
  constructor
  intro x y hxy
  cases y with
  | zero => exact absurd hxy (zero_le _).not_lt
  | coe y =>
    cases x with
    | zero => refine ⟨0, zero_le _⟩
    | coe x => simpa [← WithZero.coe_pow] using (MulArchimedean.arch x (by simpa using hxy))
Multiplicatively Archimedean Property for Monoids with Zero Adjoined
Informal description
For any multiplicatively Archimedean commutative monoid $M$ with a partial order, the monoid $M$ with a zero element adjoined is also multiplicatively Archimedean.