l3lab/ntp-mathlib huggingface dataset:
/-- The ring of integers under a given valuation is the subring of elements with valuation ≤ 1. -/
def integer : Subring R where
  carrier := { x | v x ≤ 1 }
  one_mem' := le_of_eq v.map_one
  mul_mem' {x y} hx hy := by simp only [Set.mem_setOf_eq, _root_.map_mul, mul_le_one' hx hy]
  zero_mem' := by 

Proof state:
R : Type u
Γ₀ : Type v
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
⊢ 0 ∈
    {
          toSubsemigroup :=
            { carrier := {x | v x ≤ 1},
              mul_mem' := (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
          one_mem' := (_ : v 1 ≤ 1) }.toSubsemigroup.carrier

Next tactic:
simp only [Set.mem_setOf_eq, _root_.map_zero, zero_le']
/-- The ring of integers under a given valuation is the subring of elements with valuation ≤ 1. -/
def integer : Subring R where
  carrier := { x | v x ≤ 1 }
  one_mem' := le_of_eq v.map_one
  mul_mem' {x y} hx hy := by simp only [Set.mem_setOf_eq, _root_.map_mul, mul_le_one' hx hy]
  zero_mem' := by simp only [Set.mem_setOf_eq, _root_.map_zero, zero_le']
  add_mem' {x y} hx hy := le_trans (v.map_add x y) (max_le hx hy)
  neg_mem' {x} hx := by 

Proof state:
R : Type u
Γ₀ : Type v
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x : R
hx :
  x ∈
    {
            toSubmonoid :=
              {
                toSubsemigroup :=
                  { carrier := {x | v x ≤ 1},
                    mul_mem' := (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                one_mem' := (_ : v 1 ≤ 1) },
            add_mem' :=
              (_ :
                ∀ {x y : R},
                  x ∈
                      {
                            toSubsemigroup :=
                              { carrier := {x | v x ≤ 1},
                                mul_mem' := (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                            one_mem' := (_ : v 1 ≤ 1) }.toSubsemigroup.carrier →
                    y ∈
                        {
                              toSubsemigroup :=
                                { carrier := {x | v x ≤ 1},
                                  mul_mem' :=
                                    (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                              one_mem' := (_ : v 1 ≤ 1) }.toSubsemigroup.carrier →
                      v (x + y) ≤ 1),
            zero_mem' := (_ : v 0 ≤ 1) }.toSubmonoid.toSubsemigroup.carrier
⊢ -x ∈
    {
            toSubmonoid :=
              {
                toSubsemigroup :=
                  { carrier := {x | v x ≤ 1},
                    mul_mem' := (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                one_mem' := (_ : v 1 ≤ 1) },
            add_mem' :=
              (_ :
                ∀ {x y : R},
                  x ∈
                      {
                            toSubsemigroup :=
                              { carrier := {x | v x ≤ 1},
                                mul_mem' := (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                            one_mem' := (_ : v 1 ≤ 1) }.toSubsemigroup.carrier →
                    y ∈
                        {
                              toSubsemigroup :=
                                { carrier := {x | v x ≤ 1},
                                  mul_mem' :=
                                    (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                              one_mem' := (_ : v 1 ≤ 1) }.toSubsemigroup.carrier →
                      v (x + y) ≤ 1),
            zero_mem' := (_ : v 0 ≤ 1) }.toSubmonoid.toSubsemigroup.carrier

Next tactic:
simp only [Set.mem_setOf_eq] at hx
/-- The ring of integers under a given valuation is the subring of elements with valuation ≤ 1. -/
def integer : Subring R where
  carrier := { x | v x ≤ 1 }
  one_mem' := le_of_eq v.map_one
  mul_mem' {x y} hx hy := by simp only [Set.mem_setOf_eq, _root_.map_mul, mul_le_one' hx hy]
  zero_mem' := by simp only [Set.mem_setOf_eq, _root_.map_zero, zero_le']
  add_mem' {x y} hx hy := le_trans (v.map_add x y) (max_le hx hy)
  neg_mem' {x} hx := by simp only [Set.mem_setOf_eq] at hx; 

Proof state:
R : Type u
Γ₀ : Type v
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x : R
hx : v x ≤ 1
⊢ -x ∈
    {
            toSubmonoid :=
              {
                toSubsemigroup :=
                  { carrier := {x | v x ≤ 1},
                    mul_mem' := (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                one_mem' := (_ : v 1 ≤ 1) },
            add_mem' :=
              (_ :
                ∀ {x y : R},
                  x ∈
                      {
                            toSubsemigroup :=
                              { carrier := {x | v x ≤ 1},
                                mul_mem' := (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                            one_mem' := (_ : v 1 ≤ 1) }.toSubsemigroup.carrier →
                    y ∈
                        {
                              toSubsemigroup :=
                                { carrier := {x | v x ≤ 1},
                                  mul_mem' :=
                                    (_ : ∀ {x y : R}, x ∈ {x | v x ≤ 1} → y ∈ {x | v x ≤ 1} → v (x * y) ≤ 1) },
                              one_mem' := (_ : v 1 ≤ 1) }.toSubsemigroup.carrier →
                      v (x + y) ≤ 1),
            zero_mem' := (_ : v 0 ≤ 1) }.toSubmonoid.toSubsemigroup.carrier

Next tactic:
simpa only [Set.mem_setOf_eq, map_neg]
theorem one_of_isUnit {x : O} (hx : IsUnit x) : v (algebraMap O R x) = 1 :=
  let ⟨u, hu⟩ := hx
  le_antisymm (hv.2 _) <| by
    

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : O
hx : IsUnit x
u : Oˣ
hu : ↑u = x
⊢ 1 ≤ v ((algebraMap O R) x)

Next tactic:
rw [← v.map_one, ← (algebraMap O R).map_one, ← u.mul_inv, ← mul_one (v (algebraMap O R x)), hu,
      (algebraMap O R).map_mul, v.map_mul]
theorem one_of_isUnit {x : O} (hx : IsUnit x) : v (algebraMap O R x) = 1 :=
  let ⟨u, hu⟩ := hx
  le_antisymm (hv.2 _) <| by
    rw [← v.map_one, ← (algebraMap O R).map_one, ← u.mul_inv, ← mul_one (v (algebraMap O R x)), hu,
      (algebraMap O R).map_mul, v.map_mul]
    

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : O
hx : IsUnit x
u : Oˣ
hu : ↑u = x
⊢ v ((algebraMap O R) x) * v ((algebraMap O R) ↑u⁻¹) ≤ v ((algebraMap O R) x) * 1

Next tactic:
exact mul_le_mul_left' (hv.2 (u⁻¹ : Units O)) _
theorem isUnit_of_one {x : O} (hx : IsUnit (algebraMap O R x)) (hvx : v (algebraMap O R x) = 1) :
    IsUnit x :=
  let ⟨u, hu⟩ := hx
  have h1 : v u ≤ 1 := hu.symm ▸ hv.2 x
  have h2 : v (u⁻¹ : Rˣ) ≤ 1 := by
    

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : O
hx : IsUnit ((algebraMap O R) x)
hvx : v ((algebraMap O R) x) = 1
u : Rˣ
hu : ↑u = (algebraMap O R) x
h1 : v ↑u ≤ 1
⊢ v ↑u⁻¹ ≤ 1

Next tactic:
rw [← one_mul (v _), ← hvx, ← v.map_mul, ← hu, u.mul_inv, hu, hvx, v.map_one]
theorem isUnit_of_one {x : O} (hx : IsUnit (algebraMap O R x)) (hvx : v (algebraMap O R x) = 1) :
    IsUnit x :=
  let ⟨u, hu⟩ := hx
  have h1 : v u ≤ 1 := hu.symm ▸ hv.2 x
  have h2 : v (u⁻¹ : Rˣ) ≤ 1 := by
    rw [← one_mul (v _), ← hvx, ← v.map_mul, ← hu, u.mul_inv, hu, hvx, v.map_one]
  let ⟨r1, hr1⟩ := hv.3 h1
  let ⟨r2, hr2⟩ := hv.3 h2
  ⟨⟨r1, r2, hv.1 <| by 

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : O
hx : IsUnit ((algebraMap O R) x)
hvx : v ((algebraMap O R) x) = 1
u : Rˣ
hu : ↑u = (algebraMap O R) x
h1 : v ↑u ≤ 1
h2 : v ↑u⁻¹ ≤ 1
r1 : O
hr1 : (algebraMap O R) r1 = ↑u
r2 : O
hr2 : (algebraMap O R) r2 = ↑u⁻¹
⊢ (algebraMap O R) (r1 * r2) = (algebraMap O R) 1

Next tactic:
rw [RingHom.map_mul, RingHom.map_one, hr1, hr2, Units.mul_inv]
theorem isUnit_of_one {x : O} (hx : IsUnit (algebraMap O R x)) (hvx : v (algebraMap O R x) = 1) :
    IsUnit x :=
  let ⟨u, hu⟩ := hx
  have h1 : v u ≤ 1 := hu.symm ▸ hv.2 x
  have h2 : v (u⁻¹ : Rˣ) ≤ 1 := by
    rw [← one_mul (v _), ← hvx, ← v.map_mul, ← hu, u.mul_inv, hu, hvx, v.map_one]
  let ⟨r1, hr1⟩ := hv.3 h1
  let ⟨r2, hr2⟩ := hv.3 h2
  ⟨⟨r1, r2, hv.1 <| by rw [RingHom.map_mul, RingHom.map_one, hr1, hr2, Units.mul_inv],
      hv.1 <| by 

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : O
hx : IsUnit ((algebraMap O R) x)
hvx : v ((algebraMap O R) x) = 1
u : Rˣ
hu : ↑u = (algebraMap O R) x
h1 : v ↑u ≤ 1
h2 : v ↑u⁻¹ ≤ 1
r1 : O
hr1 : (algebraMap O R) r1 = ↑u
r2 : O
hr2 : (algebraMap O R) r2 = ↑u⁻¹
⊢ (algebraMap O R) (r2 * r1) = (algebraMap O R) 1

Next tactic:
rw [RingHom.map_mul, RingHom.map_one, hr1, hr2, Units.inv_mul]
theorem le_of_dvd {x y : O} (h : x ∣ y) : v (algebraMap O R y) ≤ v (algebraMap O R x) := by
  

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x y : O
h : x ∣ y
⊢ v ((algebraMap O R) y) ≤ v ((algebraMap O R) x)

Next tactic:
let ⟨z, hz⟩ := h
theorem le_of_dvd {x y : O} (h : x ∣ y) : v (algebraMap O R y) ≤ v (algebraMap O R x) := by
  let ⟨z, hz⟩ := h
  

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x y : O
h : x ∣ y
z : O
hz : y = x * z
⊢ v ((algebraMap O R) y) ≤ v ((algebraMap O R) x)

Next tactic:
rw [← mul_one (v (algebraMap O R x)), hz, RingHom.map_mul, v.map_mul]
theorem le_of_dvd {x y : O} (h : x ∣ y) : v (algebraMap O R y) ≤ v (algebraMap O R x) := by
  let ⟨z, hz⟩ := h
  rw [← mul_one (v (algebraMap O R x)), hz, RingHom.map_mul, v.map_mul]
  

Proof state:
R : Type u
Γ₀ : Type v
inst✝⁵ : CommRing R
inst✝⁴ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝³ : CommRing O
inst✝² : Algebra O R
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x y : O
h : x ∣ y
z : O
hz : y = x * z
⊢ v ((algebraMap O R) x) * v ((algebraMap O R) z) ≤ v ((algebraMap O R) x) * 1

Next tactic:
exact mul_le_mul_left' (hv.2 z) _
theorem dvd_of_le {x y : O} (h : v (algebraMap O F x) ≤ v (algebraMap O F y)) : y ∣ x :=
  by_cases
    (fun hy : algebraMap O F y = 0 =>
      have hx : x = 0 :=
        hv.1 <|
          (algebraMap O F).map_zero.symm ▸ (v.zero_iff.1 <| le_zero_iff.1 (v.map_zero ▸ hy ▸ h))
      hx.symm ▸ dvd_zero y)
    fun hy : algebraMap O F y ≠ 0 =>
    have : v ((algebraMap O F y)⁻¹ * algebraMap O F x) ≤ 1 := by
      

Proof state:
F : Type u
Γ₀ : Type v
inst✝³ : Field F
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation F Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O F
hv : Integers v O
x y : O
h : v ((algebraMap O F) x) ≤ v ((algebraMap O F) y)
hy : (algebraMap O F) y ≠ 0
⊢ v (((algebraMap O F) y)⁻¹ * (algebraMap O F) x) ≤ 1

Next tactic:
rw [← v.map_one, ← inv_mul_cancel hy, v.map_mul, v.map_mul]
theorem dvd_of_le {x y : O} (h : v (algebraMap O F x) ≤ v (algebraMap O F y)) : y ∣ x :=
  by_cases
    (fun hy : algebraMap O F y = 0 =>
      have hx : x = 0 :=
        hv.1 <|
          (algebraMap O F).map_zero.symm ▸ (v.zero_iff.1 <| le_zero_iff.1 (v.map_zero ▸ hy ▸ h))
      hx.symm ▸ dvd_zero y)
    fun hy : algebraMap O F y ≠ 0 =>
    have : v ((algebraMap O F y)⁻¹ * algebraMap O F x) ≤ 1 := by
      rw [← v.map_one, ← inv_mul_cancel hy, v.map_mul, v.map_mul]
      

Proof state:
F : Type u
Γ₀ : Type v
inst✝³ : Field F
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation F Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O F
hv : Integers v O
x y : O
h : v ((algebraMap O F) x) ≤ v ((algebraMap O F) y)
hy : (algebraMap O F) y ≠ 0
⊢ v ((algebraMap O F) y)⁻¹ * v ((algebraMap O F) x) ≤ v ((algebraMap O F) y)⁻¹ * v ((algebraMap O F) y)

Next tactic:
exact mul_le_mul_left' h _
@[simp]
theorem range_eq {α : Type*} (f : Bool → α) : range f = {f false, f true} := by
  

Proof state:
α : Type u_1
f : Bool → α
⊢ range f = {f false, f true}

Next tactic:
rw [← image_univ, univ_eq, image_pair]
theorem tendsto_floor_atTop : Tendsto (floor : α → ℤ) atTop atTop :=
  floor_mono.tendsto_atTop_atTop fun b =>
    ⟨(b + 1 : ℤ), by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
b : ℤ
⊢ b ≤ ⌊↑(b + 1)⌋

Next tactic:
rw [floor_intCast]
theorem tendsto_floor_atTop : Tendsto (floor : α → ℤ) atTop atTop :=
  floor_mono.tendsto_atTop_atTop fun b =>
    ⟨(b + 1 : ℤ), by rw [floor_intCast]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
b : ℤ
⊢ b ≤ b + 1

Next tactic:
exact (lt_add_one _).le
theorem tendsto_ceil_atBot : Tendsto (ceil : α → ℤ) atBot atBot :=
  ceil_mono.tendsto_atBot_atBot fun b =>
    ⟨(b - 1 : ℤ), by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
b : ℤ
⊢ ⌈↑(b - 1)⌉ ≤ b

Next tactic:
rw [ceil_intCast]
theorem tendsto_ceil_atBot : Tendsto (ceil : α → ℤ) atBot atBot :=
  ceil_mono.tendsto_atBot_atBot fun b =>
    ⟨(b - 1 : ℤ), by rw [ceil_intCast]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
b : ℤ
⊢ b - 1 ≤ b

Next tactic:
exact (sub_one_lt _).le
theorem tendsto_floor_right_pure (n : ℤ) : Tendsto (floor : α → ℤ) (𝓝[≥] n) (pure n) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ Tendsto floor (𝓝[≥] ↑n) (pure n)

Next tactic:
simpa only [floor_intCast] using tendsto_floor_right_pure_floor (n : α)
theorem tendsto_ceil_left_pure (n : ℤ) : Tendsto (ceil : α → ℤ) (𝓝[≤] n) (pure n) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ Tendsto ceil (𝓝[≤] ↑n) (pure n)

Next tactic:
simpa only [ceil_intCast] using tendsto_ceil_left_pure_ceil (n : α)
theorem tendsto_floor_left_pure_ceil_sub_one (x : α) :
    Tendsto (floor : α → ℤ) (𝓝[<] x) (pure (⌈x⌉ - 1)) :=
  have h₁ : ↑(⌈x⌉ - 1) < x := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
x : α
⊢ ↑(⌈x⌉ - 1) < x

Next tactic:
rw [cast_sub, cast_one, sub_lt_iff_lt_add]
theorem tendsto_floor_left_pure_ceil_sub_one (x : α) :
    Tendsto (floor : α → ℤ) (𝓝[<] x) (pure (⌈x⌉ - 1)) :=
  have h₁ : ↑(⌈x⌉ - 1) < x := by rw [cast_sub, cast_one, sub_lt_iff_lt_add]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
x : α
⊢ ↑⌈x⌉ < x + 1

Next tactic:
exact ceil_lt_add_one _
theorem tendsto_floor_left_pure_ceil_sub_one (x : α) :
    Tendsto (floor : α → ℤ) (𝓝[<] x) (pure (⌈x⌉ - 1)) :=
  have h₁ : ↑(⌈x⌉ - 1) < x := by rw [cast_sub, cast_one, sub_lt_iff_lt_add]; exact ceil_lt_add_one _
  have h₂ : x ≤ ↑(⌈x⌉ - 1) + 1 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
x : α
h₁ : ↑(⌈x⌉ - 1) < x
⊢ x ≤ ↑(⌈x⌉ - 1) + 1

Next tactic:
rw [cast_sub, cast_one, sub_add_cancel]
theorem tendsto_floor_left_pure_ceil_sub_one (x : α) :
    Tendsto (floor : α → ℤ) (𝓝[<] x) (pure (⌈x⌉ - 1)) :=
  have h₁ : ↑(⌈x⌉ - 1) < x := by rw [cast_sub, cast_one, sub_lt_iff_lt_add]; exact ceil_lt_add_one _
  have h₂ : x ≤ ↑(⌈x⌉ - 1) + 1 := by rw [cast_sub, cast_one, sub_add_cancel]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
x : α
h₁ : ↑(⌈x⌉ - 1) < x
⊢ x ≤ ↑⌈x⌉

Next tactic:
exact le_ceil _
theorem tendsto_floor_left_pure_sub_one (n : ℤ) :
    Tendsto (floor : α → ℤ) (𝓝[<] n) (pure (n - 1)) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ Tendsto floor (𝓝[<] ↑n) (pure (n - 1))

Next tactic:
simpa only [ceil_intCast] using tendsto_floor_left_pure_ceil_sub_one (n : α)
theorem tendsto_ceil_right_pure_floor_add_one (x : α) :
    Tendsto (ceil : α → ℤ) (𝓝[>] x) (pure (⌊x⌋ + 1)) :=
  have : ↑(⌊x⌋ + 1) - 1 ≤ x := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
x : α
⊢ ↑(⌊x⌋ + 1) - 1 ≤ x

Next tactic:
rw [cast_add, cast_one, add_sub_cancel]
theorem tendsto_ceil_right_pure_floor_add_one (x : α) :
    Tendsto (ceil : α → ℤ) (𝓝[>] x) (pure (⌊x⌋ + 1)) :=
  have : ↑(⌊x⌋ + 1) - 1 ≤ x := by rw [cast_add, cast_one, add_sub_cancel]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
x : α
⊢ ↑⌊x⌋ ≤ x

Next tactic:
exact floor_le _
theorem tendsto_ceil_right_pure_add_one (n : ℤ) :
    Tendsto (ceil : α → ℤ) (𝓝[>] n) (pure (n + 1)) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ Tendsto ceil (𝓝[>] ↑n) (pure (n + 1))

Next tactic:
simpa only [floor_intCast] using tendsto_ceil_right_pure_floor_add_one (n : α)
theorem tendsto_floor_left (n : ℤ) :
    Tendsto (fun x => floor x : α → α) (𝓝[<] n) (𝓝[≤] (n - 1)) :=
  ((tendsto_pure_pure _ _).comp (tendsto_floor_left_pure_sub_one n)).mono_right <| by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ pure (IntCast.intCast (n - 1)) ≤ 𝓝[≤] (↑n - 1)

Next tactic:
rw [← @cast_one α, ← cast_sub]
theorem tendsto_floor_left (n : ℤ) :
    Tendsto (fun x => floor x : α → α) (𝓝[<] n) (𝓝[≤] (n - 1)) :=
  ((tendsto_pure_pure _ _).comp (tendsto_floor_left_pure_sub_one n)).mono_right <| by
    rw [← @cast_one α, ← cast_sub]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ pure (IntCast.intCast (n - 1)) ≤ 𝓝[≤] ↑(n - 1)

Next tactic:
exact pure_le_nhdsWithin le_rfl
theorem tendsto_ceil_right (n : ℤ) :
    Tendsto (fun x => ceil x : α → α) (𝓝[>] n) (𝓝[≥] (n + 1)) :=
  ((tendsto_pure_pure _ _).comp (tendsto_ceil_right_pure_add_one n)).mono_right <| by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ pure (IntCast.intCast (n + 1)) ≤ 𝓝[≥] (↑n + 1)

Next tactic:
rw [← @cast_one α, ← cast_add]
theorem tendsto_ceil_right (n : ℤ) :
    Tendsto (fun x => ceil x : α → α) (𝓝[>] n) (𝓝[≥] (n + 1)) :=
  ((tendsto_pure_pure _ _).comp (tendsto_ceil_right_pure_add_one n)).mono_right <| by
    rw [← @cast_one α, ← cast_add]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : LinearOrderedRing α
inst✝² : FloorRing α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
n : ℤ
⊢ pure (IntCast.intCast (n + 1)) ≤ 𝓝[≥] ↑(n + 1)

Next tactic:
exact pure_le_nhdsWithin le_rfl
theorem tendsto_fract_left' [OrderClosedTopology α] [TopologicalAddGroup α] (n : ℤ) :
    Tendsto (fract : α → α) (𝓝[<] n) (𝓝 1) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝⁴ : LinearOrderedRing α
inst✝³ : FloorRing α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
inst✝ : TopologicalAddGroup α
n : ℤ
⊢ Tendsto fract (𝓝[<] ↑n) (𝓝 1)

Next tactic:
rw [← sub_sub_cancel (n : α) 1]
theorem tendsto_fract_left' [OrderClosedTopology α] [TopologicalAddGroup α] (n : ℤ) :
    Tendsto (fract : α → α) (𝓝[<] n) (𝓝 1) := by
  rw [← sub_sub_cancel (n : α) 1]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝⁴ : LinearOrderedRing α
inst✝³ : FloorRing α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
inst✝ : TopologicalAddGroup α
n : ℤ
⊢ Tendsto fract (𝓝[<] ↑n) (𝓝 (↑n - (↑n - 1)))

Next tactic:
refine (tendsto_id.mono_left nhdsWithin_le_nhds).sub ?_
theorem tendsto_fract_left' [OrderClosedTopology α] [TopologicalAddGroup α] (n : ℤ) :
    Tendsto (fract : α → α) (𝓝[<] n) (𝓝 1) := by
  rw [← sub_sub_cancel (n : α) 1]
  refine (tendsto_id.mono_left nhdsWithin_le_nhds).sub ?_
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝⁴ : LinearOrderedRing α
inst✝³ : FloorRing α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
inst✝ : TopologicalAddGroup α
n : ℤ
⊢ Tendsto (fun x => ↑⌊x⌋) (𝓝[<] ↑n) (𝓝 (↑n - 1))

Next tactic:
exact tendsto_floor_left' n
/-- Do not use this, use `ContinuousOn.comp_fract` instead. -/
theorem ContinuousOn.comp_fract' {f : β → α → γ} (h : ContinuousOn (uncurry f) <| univ ×ˢ I)
    (hf : ∀ s, f s 0 = f s 1) : Continuous fun st : β × α => f st.1 (fract st.2) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝⁵ : LinearOrderedRing α
inst✝⁴ : FloorRing α
inst✝³ : TopologicalSpace α
inst✝² : OrderTopology α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : β → α → γ
h : ContinuousOn (uncurry f) (univ ×ˢ Icc 0 1)
hf : ∀ (s : β), f s 0 = f s 1
⊢ Continuous fun st => f st.1 (fract st.2)

Next tactic:
change Continuous (uncurry f ∘ Prod.map id fract)
/-- Do not use this, use `ContinuousOn.comp_fract` instead. -/
theorem ContinuousOn.comp_fract' {f : β → α → γ} (h : ContinuousOn (uncurry f) <| univ ×ˢ I)
    (hf : ∀ s, f s 0 = f s 1) : Continuous fun st : β × α => f st.1 (fract st.2) := by
  change Continuous (uncurry f ∘ Prod.map id fract)
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝⁵ : LinearOrderedRing α
inst✝⁴ : FloorRing α
inst✝³ : TopologicalSpace α
inst✝² : OrderTopology α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : β → α → γ
h : ContinuousOn (uncurry f) (univ ×ˢ Icc 0 1)
hf : ∀ (s : β), f s 0 = f s 1
⊢ Continuous (uncurry f ∘ Prod.map id fract)

Next tactic:
rw [continuous_iff_continuousAt]
/-- Do not use this, use `ContinuousOn.comp_fract` instead. -/
theorem ContinuousOn.comp_fract' {f : β → α → γ} (h : ContinuousOn (uncurry f) <| univ ×ˢ I)
    (hf : ∀ s, f s 0 = f s 1) : Continuous fun st : β × α => f st.1 (fract st.2) := by
  change Continuous (uncurry f ∘ Prod.map id fract)
  rw [continuous_iff_continuousAt]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝⁵ : LinearOrderedRing α
inst✝⁴ : FloorRing α
inst✝³ : TopologicalSpace α
inst✝² : OrderTopology α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : β → α → γ
h : ContinuousOn (uncurry f) (univ ×ˢ Icc 0 1)
hf : ∀ (s : β), f s 0 = f s 1
⊢ ∀ (x : β × α), ContinuousAt (uncurry f ∘ Prod.map id fract) x

Next tactic:
rintro ⟨s, t⟩