[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
C : ℝ
⊢ Tendsto (fun n => C / ↑n) atTop (𝓝 0)
[PROOFSTEP]
simpa only [mul_zero] using tendsto_const_nhds.mul tendsto_inverse_atTop_nhds_0_nat
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
⊢ Tendsto (fun n => (↑n)⁻¹) atTop (𝓝 0)
[PROOFSTEP]
rw [← NNReal.tendsto_coe]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
⊢ Tendsto (fun a => ↑(↑a)⁻¹) atTop (𝓝 ↑0)
[PROOFSTEP]
exact _root_.tendsto_inverse_atTop_nhds_0_nat
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
C : ℝ≥0
⊢ Tendsto (fun n => C / ↑n) atTop (𝓝 0)
[PROOFSTEP]
simpa using tendsto_const_nhds.mul NNReal.tendsto_inverse_atTop_nhds_0_nat
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
this : Tendsto (fun n => 1 / ↑(n + 1)) atTop (𝓝 0)
⊢ Tendsto (fun n => 1 / (↑n + 1)) atTop (𝓝 0)
[PROOFSTEP]
simpa
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁴ : Semiring 𝕜
inst✝³ : Algebra ℝ≥0 𝕜
inst✝² : TopologicalSpace 𝕜
inst✝¹ : TopologicalSemiring 𝕜
inst✝ : ContinuousSMul ℝ≥0 𝕜
⊢ Tendsto (↑(algebraMap ℝ≥0 𝕜) ∘ fun n => (↑n)⁻¹) atTop (𝓝 0)
[PROOFSTEP]
convert (continuous_algebraMap ℝ≥0 𝕜).continuousAt.tendsto.comp tendsto_inverse_atTop_nhds_0_nat
[GOAL]
case h.e'_5.h.e'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁴ : Semiring 𝕜
inst✝³ : Algebra ℝ≥0 𝕜
inst✝² : TopologicalSpace 𝕜
inst✝¹ : TopologicalSemiring 𝕜
inst✝ : ContinuousSMul ℝ≥0 𝕜
⊢ 0 = ↑(algebraMap ℝ≥0 𝕜) 0
[PROOFSTEP]
rw [map_zero]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
⊢ Tendsto (fun n => ↑n / (↑n + x)) atTop (𝓝 1)
[PROOFSTEP]
refine' Tendsto.congr' ((eventually_ne_atTop 0).mp (eventually_of_forall fun n hn => _)) _
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
⊢ ℕ → 𝕜
[PROOFSTEP]
exact fun n : ℕ => 1 / (1 + x / n)
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
n : ℕ
hn : n ≠ 0
⊢ 1 / (1 + x / ↑n) = (fun n => ↑n / (↑n + x)) n
[PROOFSTEP]
field_simp [Nat.cast_ne_zero.mpr hn]
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
⊢ Tendsto (fun n => 1 / (1 + x / ↑n)) atTop (𝓝 1)
[PROOFSTEP]
have : 𝓝 (1 : 𝕜) = 𝓝 (1 / (1 + x * (0 : 𝕜))) := by rw [mul_zero, add_zero, div_one]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
⊢ 𝓝 1 = 𝓝 (1 / (1 + x * 0))
[PROOFSTEP]
rw [mul_zero, add_zero, div_one]
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
⊢ Tendsto (fun n => 1 / (1 + x / ↑n)) atTop (𝓝 1)
[PROOFSTEP]
rw [this]
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
⊢ Tendsto (fun n => 1 / (1 + x / ↑n)) atTop (𝓝 (1 / (1 + x * 0)))
[PROOFSTEP]
refine' tendsto_const_nhds.div (tendsto_const_nhds.add _) (by simp)
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
⊢ 1 + x * 0 ≠ 0
[PROOFSTEP]
simp
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
⊢ Tendsto (fun n => x / ↑n) atTop (𝓝 (x * 0))
[PROOFSTEP]
simp_rw [div_eq_mul_inv]
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
⊢ Tendsto (fun n => x * (↑n)⁻¹) atTop (𝓝 (x * 0))
[PROOFSTEP]
refine' tendsto_const_nhds.mul _
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
⊢ Tendsto (fun n => (↑n)⁻¹) atTop (𝓝 0)
[PROOFSTEP]
have := ((continuous_algebraMap ℝ 𝕜).tendsto _).comp tendsto_inverse_atTop_nhds_0_nat
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this✝ : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
this : Tendsto (↑(algebraMap ℝ 𝕜) ∘ fun n => (↑n)⁻¹) atTop (𝓝 (↑(algebraMap ℝ 𝕜) 0))
⊢ Tendsto (fun n => (↑n)⁻¹) atTop (𝓝 0)
[PROOFSTEP]
rw [map_zero, Filter.tendsto_atTop'] at this
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this✝ : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
this : ∀ (s : Set 𝕜), s ∈ 𝓝 0 → ∃ a, ∀ (b : ℕ), b ≥ a → (↑(algebraMap ℝ 𝕜) ∘ fun n => (↑n)⁻¹) b ∈ s
⊢ Tendsto (fun n => (↑n)⁻¹) atTop (𝓝 0)
[PROOFSTEP]
refine' Iff.mpr tendsto_atTop' _
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this✝ : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
this : ∀ (s : Set 𝕜), s ∈ 𝓝 0 → ∃ a, ∀ (b : ℕ), b ≥ a → (↑(algebraMap ℝ 𝕜) ∘ fun n => (↑n)⁻¹) b ∈ s
⊢ ∀ (s : Set 𝕜), s ∈ 𝓝 0 → ∃ a, ∀ (b : ℕ), b ≥ a → (↑b)⁻¹ ∈ s
[PROOFSTEP]
intros
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝⁵ : DivisionRing 𝕜
inst✝⁴ : TopologicalSpace 𝕜
inst✝³ : CharZero 𝕜
inst✝² : Algebra ℝ 𝕜
inst✝¹ : ContinuousSMul ℝ 𝕜
inst✝ : TopologicalDivisionRing 𝕜
x : 𝕜
this✝ : 𝓝 1 = 𝓝 (1 / (1 + x * 0))
this : ∀ (s : Set 𝕜), s ∈ 𝓝 0 → ∃ a, ∀ (b : ℕ), b ≥ a → (↑(algebraMap ℝ 𝕜) ∘ fun n => (↑n)⁻¹) b ∈ s
s✝ : Set 𝕜
a✝ : s✝ ∈ 𝓝 0
⊢ ∃ a, ∀ (b : ℕ), b ≥ a → (↑b)⁻¹ ∈ s✝
[PROOFSTEP]
simp_all only [comp_apply, map_inv₀, map_natCast]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h₁ : 0 ≤ r
h₂ : r < 1
hr : 0 = r
⊢ Tendsto (fun n => r ^ (n + 1)) atTop (𝓝 0)
[PROOFSTEP]
simp [_root_.pow_succ, ← hr, tendsto_const_nhds]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h₁ : 0 ≤ r
h₂ : r < 1
hr : 0 < r
this : Tendsto (fun n => r⁻¹ ^ n) atTop atTop
n : ℕ
⊢ ((fun r => r⁻¹) ∘ fun n => r⁻¹ ^ n) n = r ^ n
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
⊢ Tendsto (fun n => r ^ n) atTop (𝓝 0) ↔ |r| < 1
[PROOFSTEP]
rw [tendsto_zero_iff_abs_tendsto_zero]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
⊢ Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0) ↔ |r| < 1
[PROOFSTEP]
refine ⟨fun h ↦ by_contra (fun hr_le ↦ ?_), fun h ↦ ?_⟩
[GOAL]
case refine_1
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
⊢ False
[PROOFSTEP]
by_cases hr : 1 = |r|
[GOAL]
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : 1 = |r|
⊢ False
[PROOFSTEP]
replace h : Tendsto (fun n : ℕ ↦ |r| ^ n) atTop (𝓝 0) := by simpa only [← abs_pow, h]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : 1 = |r|
⊢ Tendsto (fun n => |r| ^ n) atTop (𝓝 0)
[PROOFSTEP]
simpa only [← abs_pow, h]
[GOAL]
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
hr_le : ¬|r| < 1
hr : 1 = |r|
h : Tendsto (fun n => |r| ^ n) atTop (𝓝 0)
⊢ False
[PROOFSTEP]
simp only [hr.symm, one_pow] at h
[GOAL]
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
hr_le : ¬|r| < 1
hr : 1 = |r|
h : Tendsto (fun n => 1) atTop (𝓝 0)
⊢ False
[PROOFSTEP]
exact zero_ne_one <| tendsto_nhds_unique h tendsto_const_nhds
[GOAL]
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
⊢ False
[PROOFSTEP]
apply @not_tendsto_nhds_of_tendsto_atTop 𝕜 ℕ _ _ _ _ atTop _ (fun n ↦ |r| ^ n) _ 0 _
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
⊢ Tendsto (fun n => |r| ^ n) atTop atTop
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
⊢ Tendsto (fun n => |r| ^ n) atTop (𝓝 0)
[PROOFSTEP]
refine (pow_strictMono_right $ lt_of_le_of_ne (le_of_not_lt hr_le) hr).monotone.tendsto_atTop_atTop (fun b ↦ ?_)
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
b : 𝕜
⊢ ∃ a, b ≤ |r| ^ a
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
⊢ Tendsto (fun n => |r| ^ n) atTop (𝓝 0)
[PROOFSTEP]
obtain ⟨n, hn⟩ := (pow_unbounded_of_one_lt b (lt_of_le_of_ne (le_of_not_lt hr_le) hr))
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
b : 𝕜
n : ℕ
hn : b < |r| ^ n
⊢ ∃ a, b ≤ |r| ^ a
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
⊢ Tendsto (fun n => |r| ^ n) atTop (𝓝 0)
[PROOFSTEP]
exacts [⟨n, le_of_lt hn⟩, by simpa only [← abs_pow]]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
hr_le : ¬|r| < 1
hr : ¬1 = |r|
⊢ Tendsto (fun n => |r| ^ n) atTop (𝓝 0)
[PROOFSTEP]
simpa only [← abs_pow]
[GOAL]
case refine_2
α : Type u_1
β : Type u_2
ι : Type u_3
𝕜 : Type u_4
inst✝³ : LinearOrderedField 𝕜
inst✝² : Archimedean 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
r : 𝕜
h : |r| < 1
⊢ Tendsto (abs ∘ fun n => r ^ n) atTop (𝓝 0)
[PROOFSTEP]
simpa only [← abs_pow] using (tendsto_pow_atTop_nhds_0_of_lt_1 (abs_nonneg r)) h
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
hn : 0 < n
h : ∀ (k : ℕ), k < n → c * u k < u (k + 1)
⊢ c ^ n * u 0 < u n
[PROOFSTEP]
apply (monotone_mul_left_of_nonneg hc).seq_pos_lt_seq_of_le_of_lt hn _ _ h
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
hn : 0 < n
h : ∀ (k : ℕ), k < n → c * u k < u (k + 1)
⊢ c ^ 0 * u 0 ≤ u 0
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
hn : 0 < n
h : ∀ (k : ℕ), k < n → c * u k < u (k + 1)
⊢ ∀ (k : ℕ), k < n → c ^ (k + 1) * u 0 ≤ c * (c ^ k * u 0)
[PROOFSTEP]
simp [_root_.pow_succ, mul_assoc, le_refl]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
h : ∀ (k : ℕ), k < n → c * u k ≤ u (k + 1)
⊢ c ^ n * u 0 ≤ u n
[PROOFSTEP]
apply (monotone_mul_left_of_nonneg hc).seq_le_seq n _ _ h
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
h : ∀ (k : ℕ), k < n → c * u k ≤ u (k + 1)
⊢ c ^ 0 * u 0 ≤ u 0
[PROOFSTEP]
simp [_root_.pow_succ, mul_assoc, le_refl]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
h : ∀ (k : ℕ), k < n → c * u k ≤ u (k + 1)
⊢ ∀ (k : ℕ), k < n → c ^ (k + 1) * u 0 ≤ c * (c ^ k * u 0)
[PROOFSTEP]
simp [_root_.pow_succ, mul_assoc, le_refl]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
hn : 0 < n
h : ∀ (k : ℕ), k < n → u (k + 1) < c * u k
⊢ u n < c ^ n * u 0
[PROOFSTEP]
apply (monotone_mul_left_of_nonneg hc).seq_pos_lt_seq_of_lt_of_le hn _ h _
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
hn : 0 < n
h : ∀ (k : ℕ), k < n → u (k + 1) < c * u k
⊢ u 0 ≤ c ^ 0 * u 0
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
hn : 0 < n
h : ∀ (k : ℕ), k < n → u (k + 1) < c * u k
⊢ ∀ (k : ℕ), k < n → c * (c ^ k * u 0) ≤ c ^ (k + 1) * u 0
[PROOFSTEP]
simp [_root_.pow_succ, mul_assoc, le_refl]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
h : ∀ (k : ℕ), k < n → u (k + 1) ≤ c * u k
⊢ u n ≤ c ^ n * u 0
[PROOFSTEP]
apply (monotone_mul_left_of_nonneg hc).seq_le_seq n _ h _
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
h : ∀ (k : ℕ), k < n → u (k + 1) ≤ c * u k
⊢ u 0 ≤ c ^ 0 * u 0
[PROOFSTEP]
simp [_root_.pow_succ, mul_assoc, le_refl]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
u : ℕ → ℝ
c : ℝ
hc : 0 ≤ c
n : ℕ
h : ∀ (k : ℕ), k < n → u (k + 1) ≤ c * u k
⊢ ∀ (k : ℕ), k < n → c * (c ^ k * u 0) ≤ c ^ (k + 1) * u 0
[PROOFSTEP]
simp [_root_.pow_succ, mul_assoc, le_refl]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr : r < 1
⊢ Tendsto (fun a => ↑(r ^ a)) atTop (𝓝 ↑0)
[PROOFSTEP]
simp only [NNReal.coe_pow, NNReal.coe_zero, _root_.tendsto_pow_atTop_nhds_0_of_lt_1 r.coe_nonneg hr]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : r < 1
⊢ Tendsto (fun n => r ^ n) atTop (𝓝 0)
[PROOFSTEP]
rcases ENNReal.lt_iff_exists_coe.1 hr with ⟨r, rfl, hr'⟩
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' : ↑r < 1
hr : ↑r < 1
⊢ Tendsto (fun n => ↑r ^ n) atTop (𝓝 0)
[PROOFSTEP]
rw [← ENNReal.coe_zero]
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' : ↑r < 1
hr : ↑r < 1
⊢ Tendsto (fun n => ↑r ^ n) atTop (𝓝 ↑0)
[PROOFSTEP]
norm_cast at *
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' hr : r < 1
⊢ Tendsto (fun a => r ^ a) atTop (𝓝 0)
[PROOFSTEP]
apply NNReal.tendsto_pow_atTop_nhds_0_of_lt_1 hr
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ
h₁ : 0 ≤ r
h₂ : r < 1
this✝ : r ≠ 1
this : Tendsto (fun n => (r ^ n - 1) * (r - 1)⁻¹) atTop (𝓝 ((0 - 1) * (r - 1)⁻¹))
⊢ Tendsto (fun n => ∑ i in Finset.range n, r ^ i) atTop (𝓝 (1 - r)⁻¹)
[PROOFSTEP]
simp_all [neg_inv, geom_sum_eq, div_eq_mul_inv]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
⊢ HasSum (fun n => (1 / 2) ^ n) 2
[PROOFSTEP]
convert hasSum_geometric_of_lt_1 _ _
[GOAL]
case h.e'_6
α : Type u_1
β : Type u_2
ι : Type u_3
⊢ 2 = (1 - 1 / 2)⁻¹
[PROOFSTEP]
norm_num
[GOAL]
case convert_2
α : Type u_1
β : Type u_2
ι : Type u_3
⊢ 0 ≤ 1 / 2
[PROOFSTEP]
norm_num
[GOAL]
case convert_3
α : Type u_1
β : Type u_2
ι : Type u_3
⊢ 1 / 2 < 1
[PROOFSTEP]
norm_num
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ ∑ i in Finset.range n, (1 / 2) ^ i ≤ 2
[PROOFSTEP]
have : ∀ i, 0 ≤ (1 / (2 : ℝ)) ^ i := by
  intro i
  apply pow_nonneg
  norm_num
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ ∀ (i : ℕ), 0 ≤ (1 / 2) ^ i
[PROOFSTEP]
intro i
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
⊢ 0 ≤ (1 / 2) ^ i
[PROOFSTEP]
apply pow_nonneg
[GOAL]
case H
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
⊢ 0 ≤ 1 / 2
[PROOFSTEP]
norm_num
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
this : ∀ (i : ℕ), 0 ≤ (1 / 2) ^ i
⊢ ∑ i in Finset.range n, (1 / 2) ^ i ≤ 2
[PROOFSTEP]
convert sum_le_tsum (range n) (fun i _ => this i) summable_geometric_two
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
this : ∀ (i : ℕ), 0 ≤ (1 / 2) ^ i
⊢ 2 = ∑' (i : ℕ), (1 / 2) ^ i
[PROOFSTEP]
exact tsum_geometric_two.symm
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ (∑' (i : ℕ), if n ≤ i then 2⁻¹ ^ i else 0) = 2 * 2⁻¹ ^ n
[PROOFSTEP]
have A : Summable fun i : ℕ => ite (n ≤ i) ((2⁻¹ : ℝ) ^ i) 0 := by
  apply summable_of_nonneg_of_le _ _ summable_geometric_two <;>
    · intro i
      by_cases hi : n ≤ i <;> simp [hi]; apply pow_nonneg; exact zero_le_two
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ Summable fun i => if n ≤ i then 2⁻¹ ^ i else 0
[PROOFSTEP]
apply summable_of_nonneg_of_le _ _ summable_geometric_two
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ ∀ (b : ℕ), 0 ≤ if n ≤ b then 2⁻¹ ^ b else 0
[PROOFSTEP]
intro i
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
⊢ 0 ≤ if n ≤ i then 2⁻¹ ^ i else 0
[PROOFSTEP]
by_cases hi : n ≤ i
[GOAL]
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : n ≤ i
⊢ 0 ≤ if n ≤ i then 2⁻¹ ^ i else 0
[PROOFSTEP]
simp [hi]
[GOAL]
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : ¬n ≤ i
⊢ 0 ≤ if n ≤ i then 2⁻¹ ^ i else 0
[PROOFSTEP]
simp [hi]
[GOAL]
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : n ≤ i
⊢ 0 ≤ 2 ^ i
[PROOFSTEP]
apply pow_nonneg
[GOAL]
case pos.H
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : n ≤ i
⊢ 0 ≤ 2
[PROOFSTEP]
exact zero_le_two
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ ∀ (b : ℕ), (if n ≤ b then 2⁻¹ ^ b else 0) ≤ (1 / 2) ^ b
[PROOFSTEP]
intro i
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
⊢ (if n ≤ i then 2⁻¹ ^ i else 0) ≤ (1 / 2) ^ i
[PROOFSTEP]
by_cases hi : n ≤ i
[GOAL]
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : n ≤ i
⊢ (if n ≤ i then 2⁻¹ ^ i else 0) ≤ (1 / 2) ^ i
[PROOFSTEP]
simp [hi]
[GOAL]
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : ¬n ≤ i
⊢ (if n ≤ i then 2⁻¹ ^ i else 0) ≤ (1 / 2) ^ i
[PROOFSTEP]
simp [hi]
[GOAL]
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : ¬n ≤ i
⊢ 0 ≤ 2 ^ i
[PROOFSTEP]
apply pow_nonneg
[GOAL]
case neg.H
α : Type u_1
β : Type u_2
ι : Type u_3
n i : ℕ
hi : ¬n ≤ i
⊢ 0 ≤ 2
[PROOFSTEP]
exact zero_le_two
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
A : Summable fun i => if n ≤ i then 2⁻¹ ^ i else 0
⊢ (∑' (i : ℕ), if n ≤ i then 2⁻¹ ^ i else 0) = 2 * 2⁻¹ ^ n
[PROOFSTEP]
have B : ((Finset.range n).sum fun i : ℕ => ite (n ≤ i) ((2⁻¹ : ℝ) ^ i) 0) = 0 :=
  Finset.sum_eq_zero fun i hi => ite_eq_right_iff.2 fun h => (lt_irrefl _ ((Finset.mem_range.1 hi).trans_le h)).elim
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
A : Summable fun i => if n ≤ i then 2⁻¹ ^ i else 0
B : (∑ i in Finset.range n, if n ≤ i then 2⁻¹ ^ i else 0) = 0
⊢ (∑' (i : ℕ), if n ≤ i then 2⁻¹ ^ i else 0) = 2 * 2⁻¹ ^ n
[PROOFSTEP]
simp only [← _root_.sum_add_tsum_nat_add n A, B, if_true, zero_add, zero_le', le_add_iff_nonneg_left, pow_add,
  _root_.tsum_mul_right, tsum_geometric_inv_two]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
a : ℝ
⊢ HasSum (fun n => a / 2 / 2 ^ n) a
[PROOFSTEP]
convert HasSum.mul_left (a / 2) (hasSum_geometric_of_lt_1 (le_of_lt one_half_pos) one_half_lt_one) using 1
[GOAL]
case h.e'_5
α : Type u_1
β : Type u_2
ι : Type u_3
a : ℝ
⊢ (fun n => a / 2 / 2 ^ n) = fun i => a / 2 * (1 / 2) ^ i
[PROOFSTEP]
funext n
[GOAL]
case h.e'_5.h
α : Type u_1
β : Type u_2
ι : Type u_3
a : ℝ
n : ℕ
⊢ a / 2 / 2 ^ n = a / 2 * (1 / 2) ^ n
[PROOFSTEP]
simp
[GOAL]
case h.e'_5.h
α : Type u_1
β : Type u_2
ι : Type u_3
a : ℝ
n : ℕ
⊢ a / 2 / 2 ^ n = a / 2 * (2 ^ n)⁻¹
[PROOFSTEP]
rfl
[GOAL]
case h.e'_6
α : Type u_1
β : Type u_2
ι : Type u_3
a : ℝ
⊢ a = a / 2 * (1 - 1 / 2)⁻¹
[PROOFSTEP]
norm_num
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr : r < 1
⊢ HasSum (fun n => r ^ n) (1 - r)⁻¹
[PROOFSTEP]
apply NNReal.hasSum_coe.1
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr : r < 1
⊢ HasSum (fun a => ↑(r ^ a)) ↑(1 - r)⁻¹
[PROOFSTEP]
push_cast
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr : r < 1
⊢ HasSum (fun a => ↑r ^ a) (↑(1 - r))⁻¹
[PROOFSTEP]
rw [NNReal.coe_sub (le_of_lt hr)]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr : r < 1
⊢ HasSum (fun a => ↑r ^ a) (↑1 - ↑r)⁻¹
[PROOFSTEP]
exact hasSum_geometric_of_lt_1 r.coe_nonneg hr
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹
[PROOFSTEP]
cases' lt_or_le r 1 with hr hr
[GOAL]
case inl
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : r < 1
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹
[PROOFSTEP]
rcases ENNReal.lt_iff_exists_coe.1 hr with ⟨r, rfl, hr'⟩
[GOAL]
case inl.intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' : ↑r < 1
hr : ↑r < 1
⊢ ∑' (n : ℕ), ↑r ^ n = (1 - ↑r)⁻¹
[PROOFSTEP]
norm_cast at *
[GOAL]
case inl.intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' hr : r < 1
⊢ ∑' (n : ℕ), ↑(r ^ n) = (1 - ↑r)⁻¹
[PROOFSTEP]
convert ENNReal.tsum_coe_eq (NNReal.hasSum_geometric hr)
[GOAL]
case h.e'_3
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' hr : r < 1
⊢ (1 - ↑r)⁻¹ = ↑(1 - r)⁻¹
[PROOFSTEP]
rw [ENNReal.coe_inv <| ne_of_gt <| tsub_pos_iff_lt.2 hr, coe_sub, coe_one]
[GOAL]
case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹
[PROOFSTEP]
rw [tsub_eq_zero_iff_le.mpr hr, ENNReal.inv_zero, ENNReal.tsum_eq_iSup_nat, iSup_eq_top]
[GOAL]
case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
⊢ ∀ (b : ℝ≥0∞), b < ⊤ → ∃ i, b < ∑ a in Finset.range i, r ^ a
[PROOFSTEP]
refine' fun a ha => (ENNReal.exists_nat_gt (lt_top_iff_ne_top.1 ha)).imp fun n hn => lt_of_lt_of_le hn _
[GOAL]
case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
⊢ ↑n ≤ ∑ a in Finset.range n, r ^ a
[PROOFSTEP]
calc
  (n : ℝ≥0∞) = ∑ i in range n, 1 := by rw [sum_const, nsmul_one, card_range]
  _ ≤ ∑ i in range n, r ^ i := by gcongr; apply one_le_pow_of_one_le' hr
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
⊢ ↑n = ∑ i in Finset.range n, 1
[PROOFSTEP]
rw [sum_const, nsmul_one, card_range]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
⊢ ∑ i in Finset.range n, 1 ≤ ∑ i in Finset.range n, r ^ i
[PROOFSTEP]
gcongr
[GOAL]
case h
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
i✝ : ℕ
a✝ : i✝ ∈ Finset.range n
⊢ 1 ≤ r ^ i✝
[PROOFSTEP]
apply one_le_pow_of_one_le' hr
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
r C : ℝ≥0∞
hr : r < 1
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n
⊢ CauchySeq f
[PROOFSTEP]
refine' cauchySeq_of_edist_le_of_tsum_ne_top _ hu _
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
r C : ℝ≥0∞
hr : r < 1
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n
⊢ ∑' (n : ℕ), C * r ^ n ≠ ⊤
[PROOFSTEP]
rw [ENNReal.tsum_mul_left, ENNReal.tsum_geometric]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
r C : ℝ≥0∞
hr : r < 1
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n
⊢ C * (1 - r)⁻¹ ≠ ⊤
[PROOFSTEP]
refine' ENNReal.mul_ne_top hC (ENNReal.inv_ne_top.2 _)
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
r C : ℝ≥0∞
hr : r < 1
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n
⊢ 1 - r ≠ 0
[PROOFSTEP]
exact (tsub_pos_iff_lt.2 hr).ne'
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
r C : ℝ≥0∞
hr : r < 1
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ edist (f n) a ≤ C * r ^ n / (1 - r)
[PROOFSTEP]
convert edist_le_tsum_of_edist_le_of_tendsto _ hu ha _
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
r C : ℝ≥0∞
hr : r < 1
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ C * r ^ n / (1 - r) = ∑' (m : ℕ), C * r ^ (n + m)
[PROOFSTEP]
simp only [pow_add, ENNReal.tsum_mul_left, ENNReal.tsum_geometric, div_eq_mul_inv, mul_assoc]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
r C : ℝ≥0∞
hr : r < 1
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
⊢ edist (f 0) a ≤ C / (1 - r)
[PROOFSTEP]
simpa only [_root_.pow_zero, mul_one] using edist_le_of_edist_le_geometric_of_tendsto r C hu ha 0
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C / 2 ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
⊢ CauchySeq f
[PROOFSTEP]
simp only [div_eq_mul_inv, ENNReal.inv_pow] at hu
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
a : α
ha : Tendsto f atTop (𝓝 a)
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * 2⁻¹ ^ n
⊢ CauchySeq f
[PROOFSTEP]
refine' cauchySeq_of_edist_le_geometric 2⁻¹ C _ hC hu
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
a : α
ha : Tendsto f atTop (𝓝 a)
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * 2⁻¹ ^ n
⊢ 2⁻¹ < 1
[PROOFSTEP]
simp [ENNReal.one_lt_two]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C / 2 ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ edist (f n) a ≤ 2 * C / 2 ^ n
[PROOFSTEP]
simp only [div_eq_mul_inv, ENNReal.inv_pow] at *
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * 2⁻¹ ^ n
⊢ edist (f n) a ≤ 2 * C * 2⁻¹ ^ n
[PROOFSTEP]
rw [mul_assoc, mul_comm]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * 2⁻¹ ^ n
⊢ edist (f n) a ≤ C * 2⁻¹ ^ n * 2
[PROOFSTEP]
convert edist_le_of_edist_le_geometric_of_tendsto 2⁻¹ C hu ha n using 1
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * 2⁻¹ ^ n
⊢ C * 2⁻¹ ^ n * 2 = C * 2⁻¹ ^ n / (1 - 2⁻¹)
[PROOFSTEP]
rw [ENNReal.one_sub_inv_two, div_eq_mul_inv, inv_inv]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoEMetricSpace α
C : ℝ≥0∞
hC : C ≠ ⊤
f : ℕ → α
hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C / 2 ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
⊢ edist (f 0) a ≤ 2 * C
[PROOFSTEP]
simpa only [_root_.pow_zero, div_eq_mul_inv, inv_one, mul_one] using
  edist_le_of_edist_le_geometric_two_of_tendsto C hu ha 0
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
⊢ HasSum (fun n => C * r ^ n) (C / (1 - r))
[PROOFSTEP]
rcases sign_cases_of_C_mul_pow_nonneg fun n => dist_nonneg.trans (hu n) with (rfl | ⟨_, r₀⟩)
[GOAL]
case inl
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ 0 * r ^ n
⊢ HasSum (fun n => 0 * r ^ n) (0 / (1 - r))
[PROOFSTEP]
simp [hasSum_zero]
[GOAL]
case inr.intro
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
left✝ : 0 < C
r₀ : 0 ≤ r
⊢ HasSum (fun n => C * r ^ n) (C / (1 - r))
[PROOFSTEP]
refine' HasSum.mul_left C _
[GOAL]
case inr.intro
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
left✝ : 0 < C
r₀ : 0 ≤ r
⊢ HasSum (fun n => r ^ n) (1 - r)⁻¹
[PROOFSTEP]
simpa using hasSum_geometric_of_lt_1 r₀ hr
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ dist (f n) a ≤ C * r ^ n / (1 - r)
[PROOFSTEP]
have := aux_hasSum_of_le_geometric hr hu
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
this : HasSum (fun n => C * r ^ n) (C / (1 - r))
⊢ dist (f n) a ≤ C * r ^ n / (1 - r)
[PROOFSTEP]
convert dist_le_tsum_of_dist_le_of_tendsto _ hu ⟨_, this⟩ ha n
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
this : HasSum (fun n => C * r ^ n) (C / (1 - r))
⊢ C * r ^ n / (1 - r) = ∑' (m : ℕ), C * r ^ (n + m)
[PROOFSTEP]
simp only [pow_add, mul_left_comm C, mul_div_right_comm]
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
this : HasSum (fun n => C * r ^ n) (C / (1 - r))
⊢ C / (1 - r) * r ^ n = ∑' (m : ℕ), r ^ n * (C * r ^ m)
[PROOFSTEP]
rw [mul_comm]
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
this : HasSum (fun n => C * r ^ n) (C / (1 - r))
⊢ r ^ n * (C / (1 - r)) = ∑' (m : ℕ), r ^ n * (C * r ^ m)
[PROOFSTEP]
exact (this.mul_left _).tsum_eq.symm
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
hu₂ : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C / 2 / 2 ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ dist (f n) a ≤ C / 2 ^ n
[PROOFSTEP]
convert dist_le_tsum_of_dist_le_of_tendsto _ hu₂ (summable_geometric_two' C) ha n
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
hu₂ : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C / 2 / 2 ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ C / 2 ^ n = ∑' (m : ℕ), C / 2 / 2 ^ (n + m)
[PROOFSTEP]
simp only [add_comm n, pow_add, ← div_div]
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
hu₂ : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C / 2 / 2 ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ C / 2 ^ n = ∑' (m : ℕ), C / 2 / 2 ^ m / 2 ^ n
[PROOFSTEP]
symm
[GOAL]
case h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : PseudoMetricSpace α
r C : ℝ
hr : r < 1
f : ℕ → α
hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n
hu₂ : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C / 2 / 2 ^ n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ ∑' (m : ℕ), C / 2 / 2 ^ m / 2 ^ n = C / 2 ^ n
[PROOFSTEP]
exact ((hasSum_geometric_two' C).div_const _).tsum_eq
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
m : ℝ
f : ℕ → ℕ
hm : 1 < m
fi : ∀ (i : ℕ), i ≤ f i
⊢ Summable fun i => 1 / m ^ f i
[PROOFSTEP]
refine'
  summable_of_nonneg_of_le (fun a => one_div_nonneg.mpr (pow_nonneg (zero_le_one.trans hm.le) _)) (fun a => _)
    (summable_geometric_of_lt_1 (one_div_nonneg.mpr (zero_le_one.trans hm.le))
      ((one_div_lt (zero_lt_one.trans hm) zero_lt_one).mpr (one_div_one.le.trans_lt hm)))
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
m : ℝ
f : ℕ → ℕ
hm : 1 < m
fi : ∀ (i : ℕ), i ≤ f i
a : ℕ
⊢ 1 / m ^ f a ≤ (1 / m) ^ a
[PROOFSTEP]
rw [div_pow, one_pow]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
m : ℝ
f : ℕ → ℕ
hm : 1 < m
fi : ∀ (i : ℕ), i ≤ f i
a : ℕ
⊢ 1 / m ^ f a ≤ 1 / m ^ a
[PROOFSTEP]
refine' (one_div_le_one_div _ _).mpr (pow_le_pow hm.le (fi a))
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
m : ℝ
f : ℕ → ℕ
hm : 1 < m
fi : ∀ (i : ℕ), i ≤ f i
a : ℕ
⊢ 0 < m ^ f a
[PROOFSTEP]
exact pow_pos (zero_lt_one.trans hm) _
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
m : ℝ
f : ℕ → ℕ
hm : 1 < m
fi : ∀ (i : ℕ), i ≤ f i
a : ℕ
⊢ 0 < m ^ a
[PROOFSTEP]
exact pow_pos (zero_lt_one.trans hm) _
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
⊢ { ε' // (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c ≤ ε }
[PROOFSTEP]
let f n := ε / 2 / 2 ^ n
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
⊢ { ε' // (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c ≤ ε }
[PROOFSTEP]
have hf : HasSum f ε := hasSum_geometric_two' _
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
⊢ { ε' // (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c ≤ ε }
[PROOFSTEP]
have f0 : ∀ n, 0 < f n := fun n => div_pos (half_pos hε) (pow_pos zero_lt_two _)
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
f0 : ∀ (n : ℕ), 0 < f n
⊢ { ε' // (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c ≤ ε }
[PROOFSTEP]
refine' ⟨f ∘ Encodable.encode, fun i => f0 _, _⟩
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
f0 : ∀ (n : ℕ), 0 < f n
⊢ ∃ c, HasSum (f ∘ Encodable.encode) c ∧ c ≤ ε
[PROOFSTEP]
rcases hf.summable.comp_injective (@Encodable.encode_injective ι _) with ⟨c, hg⟩
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
f0 : ∀ (n : ℕ), 0 < f n
c : ℝ
hg : HasSum (f ∘ Encodable.encode) c
⊢ ∃ c, HasSum (f ∘ Encodable.encode) c ∧ c ≤ ε
[PROOFSTEP]
refine' ⟨c, hg, hasSum_le_inj _ (@Encodable.encode_injective ι _) _ _ hg hf⟩
[GOAL]
case intro.refine'_1
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
f0 : ∀ (n : ℕ), 0 < f n
c : ℝ
hg : HasSum (f ∘ Encodable.encode) c
⊢ ∀ (c : ℕ), ¬c ∈ Set.range Encodable.encode → 0 ≤ f c
[PROOFSTEP]
intro i _
[GOAL]
case intro.refine'_1
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
f0 : ∀ (n : ℕ), 0 < f n
c : ℝ
hg : HasSum (f ∘ Encodable.encode) c
i : ℕ
a✝ : ¬i ∈ Set.range Encodable.encode
⊢ 0 ≤ f i
[PROOFSTEP]
exact le_of_lt (f0 _)
[GOAL]
case intro.refine'_2
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
f0 : ∀ (n : ℕ), 0 < f n
c : ℝ
hg : HasSum (f ∘ Encodable.encode) c
⊢ ∀ (i : ι), (f ∘ Encodable.encode) i ≤ f (Encodable.encode i)
[PROOFSTEP]
intro n
[GOAL]
case intro.refine'_2
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ
hε : 0 < ε
ι : Type ?u.561991
inst✝ : Encodable ι
f : ℕ → ℝ := fun n => ε / 2 / 2 ^ n
hf : HasSum f ε
f0 : ∀ (n : ℕ), 0 < f n
c : ℝ
hg : HasSum (f ∘ Encodable.encode) c
n : ι
⊢ (f ∘ Encodable.encode) n ≤ f (Encodable.encode n)
[PROOFSTEP]
exact le_rfl
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum (fun i => ε' ↑i) c ∧ c ≤ ε
[PROOFSTEP]
haveI := hs.toEncodable
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum (fun i => ε' ↑i) c ∧ c ≤ ε
[PROOFSTEP]
rcases posSumOfEncodable hε s with ⟨f, hf0, ⟨c, hfc, hcε⟩⟩
[GOAL]
case mk.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum (fun i => ε' ↑i) c ∧ c ≤ ε
[PROOFSTEP]
refine' ⟨fun i => if h : i ∈ s then f ⟨i, h⟩ else 1, fun i => _, ⟨c, _, hcε⟩⟩
[GOAL]
case mk.intro.intro.intro.refine'_1
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
i : ι
⊢ 0 < (fun i => if h : i ∈ s then f { val := i, property := h } else 1) i
[PROOFSTEP]
conv_rhs => simp
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
i : ι
| (fun i => if h : i ∈ s then f { val := i, property := h } else 1) i
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
i : ι
| (fun i => if h : i ∈ s then f { val := i, property := h } else 1) i
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
i : ι
| (fun i => if h : i ∈ s then f { val := i, property := h } else 1) i
[PROOFSTEP]
simp
[GOAL]
case mk.intro.intro.intro.refine'_1
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
i : ι
⊢ 0 < if h : i ∈ s then f { val := i, property := h } else 1
[PROOFSTEP]
split_ifs
[GOAL]
case pos
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
i : ι
h✝ : i ∈ s
⊢ 0 < f { val := i, property := h✝ }
case neg
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
i : ι
h✝ : ¬i ∈ s
⊢ 0 < 1
[PROOFSTEP]
exacts [hf0 _, zero_lt_one]
[GOAL]
case mk.intro.intro.intro.refine'_2
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
this : Encodable ↑s
f : ↑s → ℝ
hf0 : ∀ (i : ↑s), 0 < f i
c : ℝ
hfc : HasSum f c
hcε : c ≤ ε
⊢ HasSum (fun i => (fun i => if h : i ∈ s then f { val := i, property := h } else 1) ↑i) c
[PROOFSTEP]
simpa only [Subtype.coe_prop, dif_pos, Subtype.coe_eta]
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∀ (t : Finset ι), ↑t ⊆ s → ∑ i in t, ε' i ≤ ε
[PROOFSTEP]
rcases hs.exists_pos_hasSum_le hε with ⟨ε', hpos, c, hε'c, hcε⟩
[GOAL]
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
ε' : ι → ℝ
hpos : ∀ (i : ι), 0 < ε' i
c : ℝ
hε'c : HasSum (fun i => ε' ↑i) c
hcε : c ≤ ε
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∀ (t : Finset ι), ↑t ⊆ s → ∑ i in t, ε' i ≤ ε
[PROOFSTEP]
refine' ⟨ε', hpos, fun t ht => _⟩
[GOAL]
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
ε' : ι → ℝ
hpos : ∀ (i : ι), 0 < ε' i
c : ℝ
hε'c : HasSum (fun i => ε' ↑i) c
hcε : c ≤ ε
t : Finset ι
ht : ↑t ⊆ s
⊢ ∑ i in t, ε' i ≤ ε
[PROOFSTEP]
rw [← sum_subtype_of_mem _ ht]
[GOAL]
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
ε' : ι → ℝ
hpos : ∀ (i : ι), 0 < ε' i
c : ℝ
hε'c : HasSum (fun i => ε' ↑i) c
hcε : c ≤ ε
t : Finset ι
ht : ↑t ⊆ s
⊢ ∑ x in Finset.subtype (fun x => x ∈ s) t, ε' ↑x ≤ ε
[PROOFSTEP]
refine' (sum_le_hasSum _ _ hε'c).trans hcε
[GOAL]
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ι : Type u_4
s : Set ι
hs : Set.Countable s
ε : ℝ
hε : 0 < ε
ε' : ι → ℝ
hpos : ∀ (i : ι), 0 < ε' i
c : ℝ
hε'c : HasSum (fun i => ε' ↑i) c
hcε : c ≤ ε
t : Finset ι
ht : ↑t ⊆ s
⊢ ∀ (i : ↑s), ¬i ∈ Finset.subtype (fun x => x ∈ s) t → 0 ≤ ε' ↑i
[PROOFSTEP]
exact fun _ _ => (hpos _).le
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c < ε
[PROOFSTEP]
cases nonempty_encodable ι
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
val✝ : Encodable ι
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c < ε
[PROOFSTEP]
obtain ⟨a, a0, aε⟩ := exists_between (pos_iff_ne_zero.2 hε)
[GOAL]
case intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
val✝ : Encodable ι
a : ℝ≥0
a0 : 0 < a
aε : a < ε
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c < ε
[PROOFSTEP]
obtain ⟨ε', hε', c, hc, hcε⟩ := posSumOfEncodable a0 ι
[GOAL]
case intro.intro.intro.mk.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
val✝ : Encodable ι
a : ℝ≥0
a0 : 0 < a
aε : a < ε
ε' : ι → ℝ
hε' : ∀ (i : ι), 0 < ε' i
c : ℝ
hc : HasSum ε' c
hcε : c ≤ (fun a => ↑a) a
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c < ε
[PROOFSTEP]
exact
  ⟨fun i => ⟨ε' i, (hε' i).le⟩, fun i => NNReal.coe_lt_coe.1 <| hε' i,
    ⟨c, hasSum_le (fun i => (hε' i).le) hasSum_zero hc⟩, NNReal.hasSum_coe.1 hc,
    aε.trans_le' <| NNReal.coe_le_coe.1 hcε⟩
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∑' (i : ι), ↑(ε' i) < ε
[PROOFSTEP]
rcases exists_between (pos_iff_ne_zero.2 hε) with ⟨r, h0r, hrε⟩
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
r : ℝ≥0∞
h0r : 0 < r
hrε : r < ε
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∑' (i : ι), ↑(ε' i) < ε
[PROOFSTEP]
rcases lt_iff_exists_coe.1 hrε with ⟨x, rfl, _⟩
[GOAL]
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
x : ℝ≥0
right✝ : ↑x < ε
h0r : 0 < ↑x
hrε : ↑x < ε
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∑' (i : ι), ↑(ε' i) < ε
[PROOFSTEP]
rcases NNReal.exists_pos_sum_of_countable (coe_pos.1 h0r).ne' ι with ⟨ε', hp, c, hc, hcr⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
x : ℝ≥0
right✝ : ↑x < ε
h0r : 0 < ↑x
hrε : ↑x < ε
ε' : ι → ℝ≥0
hp : ∀ (i : ι), 0 < ε' i
c : ℝ≥0
hc : HasSum ε' c
hcr : c < x
⊢ ∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∑' (i : ι), ↑(ε' i) < ε
[PROOFSTEP]
exact ⟨ε', hp, (ENNReal.tsum_coe_eq hc).symm ▸ lt_trans (coe_lt_coe.2 hcr) hrε⟩
[GOAL]
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w : ι → ℝ≥0∞
hw : ∀ (i : ι), w i ≠ ⊤
⊢ ∃ δ, (∀ (i : ι), 0 < δ i) ∧ ∑' (i : ι), w i * ↑(δ i) < ε
[PROOFSTEP]
lift w to ι → ℝ≥0 using hw
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w : ι → ℝ≥0
⊢ ∃ δ, (∀ (i : ι), 0 < δ i) ∧ ∑' (i : ι), (fun i => ↑(w i)) i * ↑(δ i) < ε
[PROOFSTEP]
rcases exists_pos_sum_of_countable hε ι with ⟨δ', Hpos, Hsum⟩
[GOAL]
case intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w δ' : ι → ℝ≥0
Hpos : ∀ (i : ι), 0 < δ' i
Hsum : ∑' (i : ι), ↑(δ' i) < ε
⊢ ∃ δ, (∀ (i : ι), 0 < δ i) ∧ ∑' (i : ι), (fun i => ↑(w i)) i * ↑(δ i) < ε
[PROOFSTEP]
have : ∀ i, 0 < max 1 (w i) := fun i => zero_lt_one.trans_le (le_max_left _ _)
[GOAL]
case intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w δ' : ι → ℝ≥0
Hpos : ∀ (i : ι), 0 < δ' i
Hsum : ∑' (i : ι), ↑(δ' i) < ε
this : ∀ (i : ι), 0 < max 1 (w i)
⊢ ∃ δ, (∀ (i : ι), 0 < δ i) ∧ ∑' (i : ι), (fun i => ↑(w i)) i * ↑(δ i) < ε
[PROOFSTEP]
refine' ⟨fun i => δ' i / max 1 (w i), fun i => div_pos (Hpos _) (this i), _⟩
[GOAL]
case intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w δ' : ι → ℝ≥0
Hpos : ∀ (i : ι), 0 < δ' i
Hsum : ∑' (i : ι), ↑(δ' i) < ε
this : ∀ (i : ι), 0 < max 1 (w i)
⊢ ∑' (i : ι), (fun i => ↑(w i)) i * ↑((fun i => δ' i / max 1 (w i)) i) < ε
[PROOFSTEP]
refine' lt_of_le_of_lt (ENNReal.tsum_le_tsum fun i => _) Hsum
[GOAL]
case intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w δ' : ι → ℝ≥0
Hpos : ∀ (i : ι), 0 < δ' i
Hsum : ∑' (i : ι), ↑(δ' i) < ε
this : ∀ (i : ι), 0 < max 1 (w i)
i : ι
⊢ (fun i => ↑(w i)) i * ↑((fun i => δ' i / max 1 (w i)) i) ≤ ↑(δ' i)
[PROOFSTEP]
rw [coe_div (this i).ne']
[GOAL]
case intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w δ' : ι → ℝ≥0
Hpos : ∀ (i : ι), 0 < δ' i
Hsum : ∑' (i : ι), ↑(δ' i) < ε
this : ∀ (i : ι), 0 < max 1 (w i)
i : ι
⊢ (fun i => ↑(w i)) i * (↑(δ' i) / ↑(max 1 (w i))) ≤ ↑(δ' i)
[PROOFSTEP]
refine' mul_le_of_le_div' (mul_le_mul_left' (ENNReal.inv_le_inv.2 _) _)
[GOAL]
case intro.intro.intro
α : Type u_1
β : Type u_2
ι✝ : Type u_3
ε : ℝ≥0∞
hε : ε ≠ 0
ι : Type u_4
inst✝ : Countable ι
w δ' : ι → ℝ≥0
Hpos : ∀ (i : ι), 0 < δ' i
Hsum : ∑' (i : ι), ↑(δ' i) < ε
this : ∀ (i : ι), 0 < max 1 (w i)
i : ι
⊢ (fun i => ↑(w i)) i ≤ ↑(max 1 (w i))
[PROOFSTEP]
exact coe_le_coe.2 (le_max_right _ _)
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ 0 ≤ ↑n !
[PROOFSTEP]
exact_mod_cast n.factorial_pos.le
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
⊢ 0 ≤ ↑n
[PROOFSTEP]
exact_mod_cast n.zero_le
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
⊢ ∀ᶠ (b : ℕ) in atTop, ↑b ! / ↑b ^ b ≤ 1 / ↑b
[PROOFSTEP]
refine' (eventually_gt_atTop 0).mono fun n hn => _
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
n : ℕ
hn : 0 < n
⊢ ↑n ! / ↑n ^ n ≤ 1 / ↑n
[PROOFSTEP]
rcases Nat.exists_eq_succ_of_ne_zero hn.ne.symm with ⟨k, rfl⟩
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
⊢ ↑(succ k)! / ↑(succ k) ^ succ k ≤ 1 / ↑(succ k)
[PROOFSTEP]
rw [← prod_range_add_one_eq_factorial, pow_eq_prod_const, div_eq_mul_inv, ← inv_eq_one_div, prod_natCast, Nat.cast_succ,
  ← prod_inv_distrib, ← prod_mul_distrib, Finset.prod_range_succ']
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
⊢ (∏ k_1 in Finset.range k, ↑(k_1 + 1 + 1) * (↑k + 1)⁻¹) * (↑(0 + 1) * (↑k + 1)⁻¹) ≤ (↑k + 1)⁻¹
[PROOFSTEP]
simp only [prod_range_succ', one_mul, Nat.cast_add, zero_add, Nat.cast_one]
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
⊢ (∏ x in Finset.range k, (↑x + 1 + 1) * (↑k + 1)⁻¹) * (↑k + 1)⁻¹ ≤ (↑k + 1)⁻¹
[PROOFSTEP]
refine' mul_le_of_le_one_left (inv_nonneg.mpr <| by exact_mod_cast hn.le) (prod_le_one _ _)
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
⊢ 0 ≤ ↑k + 1
[PROOFSTEP]
exact_mod_cast hn.le
[GOAL]
case intro.refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
⊢ ∀ (i : ℕ), i ∈ Finset.range k → 0 ≤ (↑i + 1 + 1) * (↑k + 1)⁻¹
[PROOFSTEP]
intro x hx
[GOAL]
case intro.refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
⊢ ∀ (i : ℕ), i ∈ Finset.range k → (↑i + 1 + 1) * (↑k + 1)⁻¹ ≤ 1
[PROOFSTEP]
intro x hx
[GOAL]
case intro.refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x ∈ Finset.range k
⊢ 0 ≤ (↑x + 1 + 1) * (↑k + 1)⁻¹
[PROOFSTEP]
rw [Finset.mem_range] at hx
[GOAL]
case intro.refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x ∈ Finset.range k
⊢ (↑x + 1 + 1) * (↑k + 1)⁻¹ ≤ 1
[PROOFSTEP]
rw [Finset.mem_range] at hx
[GOAL]
case intro.refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ 0 ≤ (↑x + 1 + 1) * (↑k + 1)⁻¹
[PROOFSTEP]
refine' mul_nonneg _ (inv_nonneg.mpr _)
[GOAL]
case intro.refine'_1.refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ 0 ≤ ↑x + 1 + 1
[PROOFSTEP]
norm_cast
[GOAL]
case intro.refine'_1.refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ 0 ≤ ↑k + 1
[PROOFSTEP]
norm_cast
[GOAL]
case intro.refine'_1.refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ 0 ≤ x + 1 + 1
[PROOFSTEP]
linarith
[GOAL]
case intro.refine'_1.refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ 0 ≤ k + 1
[PROOFSTEP]
linarith
[GOAL]
case intro.refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ (↑x + 1 + 1) * (↑k + 1)⁻¹ ≤ 1
[PROOFSTEP]
refine' (div_le_one <| by exact_mod_cast hn).mpr _
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ 0 < ↑k + 1
[PROOFSTEP]
exact_mod_cast hn
[GOAL]
case intro.refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ ↑x + 1 + 1 ≤ ↑k + 1
[PROOFSTEP]
norm_cast
[GOAL]
case intro.refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
k : ℕ
hn : 0 < succ k
x : ℕ
hx : x < k
⊢ x + 1 + 1 ≤ k + 1
[PROOFSTEP]
linarith
[GOAL]
α✝ : Type u_1
β : Type u_2
ι : Type u_3
α : Type u_4
inst✝¹ : LinearOrderedSemiring α
inst✝ : FloorSemiring α
x : ℕ
⊢ x ≤ ⌊max 0 (↑x + 1)⌋₊
[PROOFSTEP]
simp [Nat.le_floor_iff]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
⊢ Tendsto (fun x => ↑⌊a * x⌋₊ / x) atTop (𝓝 a)
[PROOFSTEP]
have A : Tendsto (fun x : R => a - x⁻¹) atTop (𝓝 (a - 0)) := tendsto_const_nhds.sub tendsto_inv_atTop_zero
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 (a - 0))
⊢ Tendsto (fun x => ↑⌊a * x⌋₊ / x) atTop (𝓝 a)
[PROOFSTEP]
rw [sub_zero] at A
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
⊢ Tendsto (fun x => ↑⌊a * x⌋₊ / x) atTop (𝓝 a)
[PROOFSTEP]
apply tendsto_of_tendsto_of_tendsto_of_le_of_le' A tendsto_const_nhds
[GOAL]
case hgf
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
⊢ ∀ᶠ (b : R) in atTop, a - b⁻¹ ≤ ↑⌊a * b⌋₊ / b
[PROOFSTEP]
refine' eventually_atTop.2 ⟨1, fun x hx => _⟩
[GOAL]
case hgf
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
⊢ a - x⁻¹ ≤ ↑⌊a * x⌋₊ / x
[PROOFSTEP]
simp only [le_div_iff (zero_lt_one.trans_le hx), _root_.sub_mul, inv_mul_cancel (zero_lt_one.trans_le hx).ne']
[GOAL]
case hgf
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
⊢ a * x - 1 ≤ ↑⌊a * x⌋₊
[PROOFSTEP]
have := Nat.lt_floor_add_one (a * x)
[GOAL]
case hgf
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
this : a * x < ↑⌊a * x⌋₊ + 1
⊢ a * x - 1 ≤ ↑⌊a * x⌋₊
[PROOFSTEP]
linarith
[GOAL]
case hfh
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
⊢ ∀ᶠ (b : R) in atTop, ↑⌊a * b⌋₊ / b ≤ a
[PROOFSTEP]
refine' eventually_atTop.2 ⟨1, fun x hx => _⟩
[GOAL]
case hfh
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
⊢ ↑⌊a * x⌋₊ / x ≤ a
[PROOFSTEP]
rw [div_le_iff (zero_lt_one.trans_le hx)]
[GOAL]
case hfh
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a - x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
⊢ ↑⌊a * x⌋₊ ≤ a * x
[PROOFSTEP]
simp [Nat.floor_le (mul_nonneg ha (zero_le_one.trans hx))]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
⊢ Tendsto (fun x => ↑⌊x⌋₊ / x) atTop (𝓝 1)
[PROOFSTEP]
simpa using tendsto_nat_floor_mul_div_atTop (zero_le_one' R)
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
⊢ Tendsto (fun x => ↑⌈a * x⌉₊ / x) atTop (𝓝 a)
[PROOFSTEP]
have A : Tendsto (fun x : R => a + x⁻¹) atTop (𝓝 (a + 0)) := tendsto_const_nhds.add tendsto_inv_atTop_zero
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a + x⁻¹) atTop (𝓝 (a + 0))
⊢ Tendsto (fun x => ↑⌈a * x⌉₊ / x) atTop (𝓝 a)
[PROOFSTEP]
rw [add_zero] at A
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a + x⁻¹) atTop (𝓝 a)
⊢ Tendsto (fun x => ↑⌈a * x⌉₊ / x) atTop (𝓝 a)
[PROOFSTEP]
apply tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds A
[GOAL]
case hgf
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a + x⁻¹) atTop (𝓝 a)
⊢ ∀ᶠ (b : R) in atTop, a ≤ ↑⌈a * b⌉₊ / b
[PROOFSTEP]
refine' eventually_atTop.2 ⟨1, fun x hx => _⟩
[GOAL]
case hgf
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a + x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
⊢ a ≤ ↑⌈a * x⌉₊ / x
[PROOFSTEP]
rw [le_div_iff (zero_lt_one.trans_le hx)]
[GOAL]
case hgf
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a + x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
⊢ a * x ≤ ↑⌈a * x⌉₊
[PROOFSTEP]
exact Nat.le_ceil _
[GOAL]
case hfh
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a + x⁻¹) atTop (𝓝 a)
⊢ ∀ᶠ (b : R) in atTop, ↑⌈a * b⌉₊ / b ≤ a + b⁻¹
[PROOFSTEP]
refine' eventually_atTop.2 ⟨1, fun x hx => _⟩
[GOAL]
case hfh
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
a : R
ha : 0 ≤ a
A : Tendsto (fun x => a + x⁻¹) atTop (𝓝 a)
x : R
hx : x ≥ 1
⊢ ↑⌈a * x⌉₊ / x ≤ a + x⁻¹
[PROOFSTEP]
simp [div_le_iff (zero_lt_one.trans_le hx), inv_mul_cancel (zero_lt_one.trans_le hx).ne',
  (Nat.ceil_lt_add_one (mul_nonneg ha (zero_le_one.trans hx))).le, add_mul]
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u_3
R : Type u_4
inst✝³ : TopologicalSpace R
inst✝² : LinearOrderedField R
inst✝¹ : OrderTopology R
inst✝ : FloorRing R
⊢ Tendsto (fun x => ↑⌈x⌉₊ / x) atTop (𝓝 1)
[PROOFSTEP]
simpa using tendsto_nat_ceil_mul_div_atTop (zero_le_one' R)


[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k : ℕ
h : ∀ (i : ℕ), i < k + 1 → coeff x i = 0
⊢ ↑verschiebung (shift x (Nat.succ k)) = shift x k
[PROOFSTEP]
ext ⟨j⟩
[GOAL]
case h.zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k : ℕ
h : ∀ (i : ℕ), i < k + 1 → coeff x i = 0
⊢ coeff (↑verschiebung (shift x (Nat.succ k))) Nat.zero = coeff (shift x k) Nat.zero
[PROOFSTEP]
rw [verschiebung_coeff_zero, shift_coeff, h]
[GOAL]
case h.zero.a
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k : ℕ
h : ∀ (i : ℕ), i < k + 1 → coeff x i = 0
⊢ k + Nat.zero < k + 1
[PROOFSTEP]
apply Nat.lt_succ_self
[GOAL]
case h.succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k : ℕ
h : ∀ (i : ℕ), i < k + 1 → coeff x i = 0
n✝ : ℕ
⊢ coeff (↑verschiebung (shift x (Nat.succ k))) (Nat.succ n✝) = coeff (shift x k) (Nat.succ n✝)
[PROOFSTEP]
simp only [verschiebung_coeff_succ, shift]
[GOAL]
case h.succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k : ℕ
h : ∀ (i : ℕ), i < k + 1 → coeff x i = 0
n✝ : ℕ
⊢ coeff x (Nat.succ k + n✝) = coeff x (k + Nat.succ n✝)
[PROOFSTEP]
congr 1
[GOAL]
case h.succ.e_a
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k : ℕ
h : ∀ (i : ℕ), i < k + 1 → coeff x i = 0
n✝ : ℕ
⊢ Nat.succ k + n✝ = k + Nat.succ n✝
[PROOFSTEP]
rw [Nat.add_succ, add_comm, Nat.add_succ, add_comm]
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
h : ∀ (i : ℕ), i < n → coeff x i = 0
⊢ x = (↑verschiebung)^[n] (shift x n)
[PROOFSTEP]
induction' n with k ih
[GOAL]
case zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
h✝ : ∀ (i : ℕ), i < n → coeff x i = 0
h : ∀ (i : ℕ), i < Nat.zero → coeff x i = 0
⊢ x = (↑verschiebung)^[Nat.zero] (shift x Nat.zero)
[PROOFSTEP]
cases x
[GOAL]
case zero.mk'
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
n : ℕ
coeff✝ : ℕ → R
h✝ : ∀ (i : ℕ), i < n → coeff { coeff := coeff✝ } i = 0
h : ∀ (i : ℕ), i < Nat.zero → coeff { coeff := coeff✝ } i = 0
⊢ { coeff := coeff✝ } = (↑verschiebung)^[Nat.zero] (shift { coeff := coeff✝ } Nat.zero)
[PROOFSTEP]
simp [shift]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
h✝ : ∀ (i : ℕ), i < n → coeff x i = 0
k : ℕ
ih : (∀ (i : ℕ), i < k → coeff x i = 0) → x = (↑verschiebung)^[k] (shift x k)
h : ∀ (i : ℕ), i < Nat.succ k → coeff x i = 0
⊢ x = (↑verschiebung)^[Nat.succ k] (shift x (Nat.succ k))
[PROOFSTEP]
dsimp
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
h✝ : ∀ (i : ℕ), i < n → coeff x i = 0
k : ℕ
ih : (∀ (i : ℕ), i < k → coeff x i = 0) → x = (↑verschiebung)^[k] (shift x k)
h : ∀ (i : ℕ), i < Nat.succ k → coeff x i = 0
⊢ x = (↑verschiebung)^[k] (↑verschiebung (shift x (Nat.succ k)))
[PROOFSTEP]
rw [verschiebung_shift]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
h✝ : ∀ (i : ℕ), i < n → coeff x i = 0
k : ℕ
ih : (∀ (i : ℕ), i < k → coeff x i = 0) → x = (↑verschiebung)^[k] (shift x k)
h : ∀ (i : ℕ), i < Nat.succ k → coeff x i = 0
⊢ x = (↑verschiebung)^[k] (shift x k)
[PROOFSTEP]
exact ih fun i hi => h _ (hi.trans (Nat.lt_succ_self _))
[GOAL]
case succ.h
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
h✝ : ∀ (i : ℕ), i < n → coeff x i = 0
k : ℕ
ih : (∀ (i : ℕ), i < k → coeff x i = 0) → x = (↑verschiebung)^[k] (shift x k)
h : ∀ (i : ℕ), i < Nat.succ k → coeff x i = 0
⊢ ∀ (i : ℕ), i < k + 1 → coeff x i = 0
[PROOFSTEP]
exact h
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
⊢ ∃ n x', coeff x' 0 ≠ 0 ∧ x = (↑verschiebung)^[n] x'
[PROOFSTEP]
have hex : ∃ k : ℕ, x.coeff k ≠ 0 := by
  by_contra' hall
  apply hx
  ext i
  simp only [hall, zero_coeff]
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
⊢ ∃ k, coeff x k ≠ 0
[PROOFSTEP]
by_contra' hall
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
hall : ∀ (k : ℕ), coeff x k = 0
⊢ False
[PROOFSTEP]
apply hx
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
hall : ∀ (k : ℕ), coeff x k = 0
⊢ x = 0
[PROOFSTEP]
ext i
[GOAL]
case h
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
hall : ∀ (k : ℕ), coeff x k = 0
i : ℕ
⊢ coeff x i = coeff 0 i
[PROOFSTEP]
simp only [hall, zero_coeff]
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
hex : ∃ k, coeff x k ≠ 0
⊢ ∃ n x', coeff x' 0 ≠ 0 ∧ x = (↑verschiebung)^[n] x'
[PROOFSTEP]
let n := Nat.find hex
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
hex : ∃ k, coeff x k ≠ 0
n : ℕ := Nat.find hex
⊢ ∃ n x', coeff x' 0 ≠ 0 ∧ x = (↑verschiebung)^[n] x'
[PROOFSTEP]
use n, x.shift n
[GOAL]
case h
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
hex : ∃ k, coeff x k ≠ 0
n : ℕ := Nat.find hex
⊢ coeff (shift x n) 0 ≠ 0 ∧ x = (↑verschiebung)^[n] (shift x n)
[PROOFSTEP]
refine' ⟨Nat.find_spec hex, eq_iterate_verschiebung fun i hi => not_not.mp _⟩
[GOAL]
case h
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
hx : x ≠ 0
hex : ∃ k, coeff x k ≠ 0
n : ℕ := Nat.find hex
i : ℕ
hi : i < n
⊢ ¬¬coeff x i = 0
[PROOFSTEP]
exact Nat.find_min hex hi
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
x y : 𝕎 R
⊢ x * y = 0 → x = 0 ∨ y = 0
[PROOFSTEP]
contrapose!
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
x y : 𝕎 R
⊢ x ≠ 0 ∧ y ≠ 0 → x * y ≠ 0
[PROOFSTEP]
rintro ⟨ha, hb⟩
[GOAL]
case intro
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
x y : 𝕎 R
ha : x ≠ 0
hb : y ≠ 0
⊢ x * y ≠ 0
[PROOFSTEP]
rcases verschiebung_nonzero ha with ⟨na, wa, hwa0, rfl⟩
[GOAL]
case intro.intro.intro.intro
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
y : 𝕎 R
hb : y ≠ 0
na : ℕ
wa : 𝕎 R
hwa0 : coeff wa 0 ≠ 0
ha : (↑verschiebung)^[na] wa ≠ 0
⊢ (↑verschiebung)^[na] wa * y ≠ 0
[PROOFSTEP]
rcases verschiebung_nonzero hb with ⟨nb, wb, hwb0, rfl⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.intro
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
na : ℕ
wa : 𝕎 R
hwa0 : coeff wa 0 ≠ 0
ha : (↑verschiebung)^[na] wa ≠ 0
nb : ℕ
wb : 𝕎 R
hwb0 : coeff wb 0 ≠ 0
hb : (↑verschiebung)^[nb] wb ≠ 0
⊢ (↑verschiebung)^[na] wa * (↑verschiebung)^[nb] wb ≠ 0
[PROOFSTEP]
refine' ne_of_apply_ne (fun x => x.coeff (na + nb)) _
[GOAL]
case intro.intro.intro.intro.intro.intro.intro
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
na : ℕ
wa : 𝕎 R
hwa0 : coeff wa 0 ≠ 0
ha : (↑verschiebung)^[na] wa ≠ 0
nb : ℕ
wb : 𝕎 R
hwb0 : coeff wb 0 ≠ 0
hb : (↑verschiebung)^[nb] wb ≠ 0
⊢ (fun x => coeff x (na + nb)) ((↑verschiebung)^[na] wa * (↑verschiebung)^[nb] wb) ≠ (fun x => coeff x (na + nb)) 0
[PROOFSTEP]
dsimp only
[GOAL]
case intro.intro.intro.intro.intro.intro.intro
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
na : ℕ
wa : 𝕎 R
hwa0 : coeff wa 0 ≠ 0
ha : (↑verschiebung)^[na] wa ≠ 0
nb : ℕ
wb : 𝕎 R
hwb0 : coeff wb 0 ≠ 0
hb : (↑verschiebung)^[nb] wb ≠ 0
⊢ coeff ((↑verschiebung)^[na] wa * (↑verschiebung)^[nb] wb) (na + nb) ≠ coeff 0 (na + nb)
[PROOFSTEP]
rw [iterate_verschiebung_mul_coeff, zero_coeff]
[GOAL]
case intro.intro.intro.intro.intro.intro.intro
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : CharP R p
inst✝ : NoZeroDivisors R
na : ℕ
wa : 𝕎 R
hwa0 : coeff wa 0 ≠ 0
ha : (↑verschiebung)^[na] wa ≠ 0
nb : ℕ
wb : 𝕎 R
hwb0 : coeff wb 0 ≠ 0
hb : (↑verschiebung)^[nb] wb ≠ 0
⊢ coeff wa 0 ^ p ^ nb * coeff wb 0 ^ p ^ na ≠ 0
[PROOFSTEP]
exact mul_ne_zero (pow_ne_zero _ hwa0) (pow_ne_zero _ hwb0)


[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : NonUnitalNonAssocSemiring β
f g : α →ₙ+* β
h : (fun f => f.toFun) f = (fun f => f.toFun) g
⊢ f = g
[PROOFSTEP]
cases f
[GOAL]
case mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : NonUnitalNonAssocSemiring β
g : α →ₙ+* β
toMulHom✝ : α →ₙ* β
map_zero'✝ : MulHom.toFun toMulHom✝ 0 = 0
map_add'✝ : ∀ (x y : α), MulHom.toFun toMulHom✝ (x + y) = MulHom.toFun toMulHom✝ x + MulHom.toFun toMulHom✝ y
h : (fun f => f.toFun) { toMulHom := toMulHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ } = (fun f => f.toFun) g
⊢ { toMulHom := toMulHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ } = g
[PROOFSTEP]
cases g
[GOAL]
case mk.mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : NonUnitalNonAssocSemiring β
toMulHom✝¹ : α →ₙ* β
map_zero'✝¹ : MulHom.toFun toMulHom✝¹ 0 = 0
map_add'✝¹ : ∀ (x y : α), MulHom.toFun toMulHom✝¹ (x + y) = MulHom.toFun toMulHom✝¹ x + MulHom.toFun toMulHom✝¹ y
toMulHom✝ : α →ₙ* β
map_zero'✝ : MulHom.toFun toMulHom✝ 0 = 0
map_add'✝ : ∀ (x y : α), MulHom.toFun toMulHom✝ (x + y) = MulHom.toFun toMulHom✝ x + MulHom.toFun toMulHom✝ y
h :
  (fun f => f.toFun) { toMulHom := toMulHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toMulHom := toMulHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
⊢ { toMulHom := toMulHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    { toMulHom := toMulHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
[PROOFSTEP]
congr
[GOAL]
case mk.mk.e_toMulHom
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : NonUnitalNonAssocSemiring β
toMulHom✝¹ : α →ₙ* β
map_zero'✝¹ : MulHom.toFun toMulHom✝¹ 0 = 0
map_add'✝¹ : ∀ (x y : α), MulHom.toFun toMulHom✝¹ (x + y) = MulHom.toFun toMulHom✝¹ x + MulHom.toFun toMulHom✝¹ y
toMulHom✝ : α →ₙ* β
map_zero'✝ : MulHom.toFun toMulHom✝ 0 = 0
map_add'✝ : ∀ (x y : α), MulHom.toFun toMulHom✝ (x + y) = MulHom.toFun toMulHom✝ x + MulHom.toFun toMulHom✝ y
h :
  (fun f => f.toFun) { toMulHom := toMulHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toMulHom := toMulHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
⊢ toMulHom✝¹ = toMulHom✝
[PROOFSTEP]
apply FunLike.coe_injective'
[GOAL]
case mk.mk.e_toMulHom.a
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : NonUnitalNonAssocSemiring β
toMulHom✝¹ : α →ₙ* β
map_zero'✝¹ : MulHom.toFun toMulHom✝¹ 0 = 0
map_add'✝¹ : ∀ (x y : α), MulHom.toFun toMulHom✝¹ (x + y) = MulHom.toFun toMulHom✝¹ x + MulHom.toFun toMulHom✝¹ y
toMulHom✝ : α →ₙ* β
map_zero'✝ : MulHom.toFun toMulHom✝ 0 = 0
map_add'✝ : ∀ (x y : α), MulHom.toFun toMulHom✝ (x + y) = MulHom.toFun toMulHom✝ x + MulHom.toFun toMulHom✝ y
h :
  (fun f => f.toFun) { toMulHom := toMulHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toMulHom := toMulHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
⊢ ↑toMulHom✝¹ = ↑toMulHom✝
[PROOFSTEP]
exact h
[GOAL]
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α✝
inst✝¹ : NonUnitalNonAssocSemiring β
α : Type u_5
inst✝ : NonUnitalNonAssocSemiring α
⊢ α →ₙ+* α
[PROOFSTEP]
refine' { toFun := id .. }
[GOAL]
case refine'_1
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α✝
inst✝¹ : NonUnitalNonAssocSemiring β
α : Type u_5
inst✝ : NonUnitalNonAssocSemiring α
⊢ ∀ (x y : α), id (x * y) = id x * id y
[PROOFSTEP]
intros
[GOAL]
case refine'_2
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α✝
inst✝¹ : NonUnitalNonAssocSemiring β
α : Type u_5
inst✝ : NonUnitalNonAssocSemiring α
⊢ MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id x * id y) } 0 = 0
[PROOFSTEP]
intros
[GOAL]
case refine'_3
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α✝
inst✝¹ : NonUnitalNonAssocSemiring β
α : Type u_5
inst✝ : NonUnitalNonAssocSemiring α
⊢ ∀ (x y : α),
    MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id x * id y) } (x + y) =
      MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id x * id y) } x +
        MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id x * id y) } y
[PROOFSTEP]
intros
[GOAL]
case refine'_1
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α✝
inst✝¹ : NonUnitalNonAssocSemiring β
α : Type u_5
inst✝ : NonUnitalNonAssocSemiring α
x✝ y✝ : α
⊢ id (x✝ * y✝) = id x✝ * id y✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_2
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α✝
inst✝¹ : NonUnitalNonAssocSemiring β
α : Type u_5
inst✝ : NonUnitalNonAssocSemiring α
⊢ MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id (x * y)) } 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case refine'_3
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α✝
inst✝¹ : NonUnitalNonAssocSemiring β
α : Type u_5
inst✝ : NonUnitalNonAssocSemiring α
x✝ y✝ : α
⊢ MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id (x * y)) } (x✝ + y✝) =
    MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id (x * y)) } x✝ +
      MulHom.toFun { toFun := id, map_mul' := (_ : ∀ (x y : α), id (x * y) = id (x * y)) } y✝
[PROOFSTEP]
rfl
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α
inst✝¹ : NonUnitalNonAssocSemiring β
inst✝ : NonUnitalNonAssocSemiring γ
g✝ : β →ₙ+* γ
f : α →ₙ+* β
g : β →ₙ+* γ
⊢ comp g 0 = 0
[PROOFSTEP]
ext
[GOAL]
case a
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α
inst✝¹ : NonUnitalNonAssocSemiring β
inst✝ : NonUnitalNonAssocSemiring γ
g✝ : β →ₙ+* γ
f : α →ₙ+* β
g : β →ₙ+* γ
x✝ : α
⊢ ↑(comp g 0) x✝ = ↑0 x✝
[PROOFSTEP]
simp
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α
inst✝¹ : NonUnitalNonAssocSemiring β
inst✝ : NonUnitalNonAssocSemiring γ
g : β →ₙ+* γ
f✝ f : α →ₙ+* β
⊢ comp 0 f = 0
[PROOFSTEP]
ext
[GOAL]
case a
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α
inst✝¹ : NonUnitalNonAssocSemiring β
inst✝ : NonUnitalNonAssocSemiring γ
g : β →ₙ+* γ
f✝ f : α →ₙ+* β
x✝ : α
⊢ ↑(comp 0 f) x✝ = ↑0 x✝
[PROOFSTEP]
rfl
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonUnitalNonAssocSemiring α
inst✝¹ : NonUnitalNonAssocSemiring β
inst✝ : NonUnitalNonAssocSemiring γ
g✝ : β →ₙ+* γ
f : α →ₙ+* β
g : β →ₙ+* γ
f₁ f₂ : α →ₙ+* β
hg : Injective ↑g
h : comp g f₁ = comp g f₂
x : α
⊢ ↑g (↑f₁ x) = ↑g (↑f₂ x)
[PROOFSTEP]
rw [← comp_apply, h, comp_apply]
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : NonAssocSemiring α
inst✝¹ : NonAssocSemiring β
inst✝ : RingHomClass F α β
f : F
a : α
⊢ ↑f (bit1 a) = bit1 (↑f a)
[PROOFSTEP]
simp [bit1]
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f g : α →+* β
h : (fun f => f.toFun) f = (fun f => f.toFun) g
⊢ f = g
[PROOFSTEP]
cases f
[GOAL]
case mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
g : α →+* β
toMonoidHom✝ : α →* β
map_zero'✝ : OneHom.toFun (↑toMonoidHom✝) 0 = 0
map_add'✝ :
  ∀ (x y : α), OneHom.toFun (↑toMonoidHom✝) (x + y) = OneHom.toFun (↑toMonoidHom✝) x + OneHom.toFun (↑toMonoidHom✝) y
h :
  (fun f => f.toFun) { toMonoidHom := toMonoidHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ } =
    (fun f => f.toFun) g
⊢ { toMonoidHom := toMonoidHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ } = g
[PROOFSTEP]
cases g
[GOAL]
case mk.mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
toMonoidHom✝¹ : α →* β
map_zero'✝¹ : OneHom.toFun (↑toMonoidHom✝¹) 0 = 0
map_add'✝¹ :
  ∀ (x y : α), OneHom.toFun (↑toMonoidHom✝¹) (x + y) = OneHom.toFun (↑toMonoidHom✝¹) x + OneHom.toFun (↑toMonoidHom✝¹) y
toMonoidHom✝ : α →* β
map_zero'✝ : OneHom.toFun (↑toMonoidHom✝) 0 = 0
map_add'✝ :
  ∀ (x y : α), OneHom.toFun (↑toMonoidHom✝) (x + y) = OneHom.toFun (↑toMonoidHom✝) x + OneHom.toFun (↑toMonoidHom✝) y
h :
  (fun f => f.toFun) { toMonoidHom := toMonoidHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toMonoidHom := toMonoidHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
⊢ { toMonoidHom := toMonoidHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    { toMonoidHom := toMonoidHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
[PROOFSTEP]
congr
[GOAL]
case mk.mk.e_toMonoidHom
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
toMonoidHom✝¹ : α →* β
map_zero'✝¹ : OneHom.toFun (↑toMonoidHom✝¹) 0 = 0
map_add'✝¹ :
  ∀ (x y : α), OneHom.toFun (↑toMonoidHom✝¹) (x + y) = OneHom.toFun (↑toMonoidHom✝¹) x + OneHom.toFun (↑toMonoidHom✝¹) y
toMonoidHom✝ : α →* β
map_zero'✝ : OneHom.toFun (↑toMonoidHom✝) 0 = 0
map_add'✝ :
  ∀ (x y : α), OneHom.toFun (↑toMonoidHom✝) (x + y) = OneHom.toFun (↑toMonoidHom✝) x + OneHom.toFun (↑toMonoidHom✝) y
h :
  (fun f => f.toFun) { toMonoidHom := toMonoidHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toMonoidHom := toMonoidHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
⊢ toMonoidHom✝¹ = toMonoidHom✝
[PROOFSTEP]
apply FunLike.coe_injective'
[GOAL]
case mk.mk.e_toMonoidHom.a
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
toMonoidHom✝¹ : α →* β
map_zero'✝¹ : OneHom.toFun (↑toMonoidHom✝¹) 0 = 0
map_add'✝¹ :
  ∀ (x y : α), OneHom.toFun (↑toMonoidHom✝¹) (x + y) = OneHom.toFun (↑toMonoidHom✝¹) x + OneHom.toFun (↑toMonoidHom✝¹) y
toMonoidHom✝ : α →* β
map_zero'✝ : OneHom.toFun (↑toMonoidHom✝) 0 = 0
map_add'✝ :
  ∀ (x y : α), OneHom.toFun (↑toMonoidHom✝) (x + y) = OneHom.toFun (↑toMonoidHom✝) x + OneHom.toFun (↑toMonoidHom✝) y
h :
  (fun f => f.toFun) { toMonoidHom := toMonoidHom✝¹, map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toMonoidHom := toMonoidHom✝, map_zero' := map_zero'✝, map_add' := map_add'✝ }
⊢ ↑toMonoidHom✝¹ = ↑toMonoidHom✝
[PROOFSTEP]
exact h
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f : α →+* β
⊢ ↑(toMonoidWithZeroHom f) = ↑f
[PROOFSTEP]
rfl
[GOAL]
F✝ : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f✝ : α →+* β
x y : α
F : Type u_5
inst✝¹ : RingHomClass F α β
f : F
p : Prop
inst✝ : Decidable p
⊢ ↑f (if p then 0 else 1) = if p then 0 else 1
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
F✝ : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f✝ : α →+* β
x y : α
F : Type u_5
inst✝¹ : RingHomClass F α β
f : F
p : Prop
inst✝ : Decidable p
h : p
⊢ ↑f (if p then 0 else 1) = 0
[PROOFSTEP]
simp [h]
[GOAL]
case neg
F✝ : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f✝ : α →+* β
x y : α
F : Type u_5
inst✝¹ : RingHomClass F α β
f : F
p : Prop
inst✝ : Decidable p
h : ¬p
⊢ ↑f (if p then 0 else 1) = 1
[PROOFSTEP]
simp [h]
[GOAL]
F✝ : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f✝ : α →+* β
x y : α
F : Type u_5
inst✝¹ : RingHomClass F α β
f : F
p : Prop
inst✝ : Decidable p
⊢ ↑f (if p then 1 else 0) = if p then 1 else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
F✝ : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f✝ : α →+* β
x y : α
F : Type u_5
inst✝¹ : RingHomClass F α β
f : F
p : Prop
inst✝ : Decidable p
h : p
⊢ ↑f (if p then 1 else 0) = 1
[PROOFSTEP]
simp [h]
[GOAL]
case neg
F✝ : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f✝ : α →+* β
x y : α
F : Type u_5
inst✝¹ : RingHomClass F α β
f : F
p : Prop
inst✝ : Decidable p
h : ¬p
⊢ ↑f (if p then 1 else 0) = 0
[PROOFSTEP]
simp [h]
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f : α →+* β
x y : α
⊢ 0 = 1 ↔ ↑f 1 = 0
[PROOFSTEP]
rw [map_one, eq_comm]
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝² : NonAssocSemiring α
x✝¹ : NonAssocSemiring β
f : α →+* β
x✝ y : α
h : ↑f 1 = 0
x : α
⊢ ↑f x = 0
[PROOFSTEP]
rw [← mul_one x, map_mul, h, mul_zero]
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝³ : NonAssocSemiring α
x✝² : NonAssocSemiring β
f : α →+* β
x✝¹ y✝ : α
h : ∀ (x : α), ↑f x = 0
y : β
x✝ : y ∈ Set.range ↑f
x : α
hx : ↑f x = y
⊢ y ∈ {0}
[PROOFSTEP]
simp [← hx, h x]
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f : α →+* β
x y✝ : α
h : ∀ (x : α), ↑f x = 0
y : β
hy : y ∈ {0}
⊢ ↑f 0 = y
[PROOFSTEP]
simpa using hy.symm
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f : α →+* β
x y : α
inst✝ : Nontrivial β
h : 1 = 0
⊢ ↑f 1 = 0
[PROOFSTEP]
rw [h, map_zero]
[GOAL]
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α✝
x✝ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
⊢ α →+* α
[PROOFSTEP]
refine' { toFun := _root_.id .. }
[GOAL]
case refine'_1
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α✝
x✝ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
⊢ _root_.id 1 = 1
[PROOFSTEP]
intros
[GOAL]
case refine'_2
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α✝
x✝ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
⊢ ∀ (x y : α),
    OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } (x * y) =
      OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } x *
        OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } y
[PROOFSTEP]
intros
[GOAL]
case refine'_3
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α✝
x✝ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := _root_.id, map_one' := ?refine'_1 },
          map_mul' :=
            (_ :
              ∀ (x y : α),
                OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } (x * y) =
                  OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } x *
                    OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } y) })
      0 =
    0
[PROOFSTEP]
intros
[GOAL]
case refine'_4
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α✝
x✝ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
⊢ ∀ (x y : α),
    OneHom.toFun
        (↑{ toOneHom := { toFun := _root_.id, map_one' := ?refine'_1 },
            map_mul' :=
              (_ :
                ∀ (x y : α),
                  OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } (x * y) =
                    OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } x *
                      OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } y) })
        (x + y) =
      OneHom.toFun
          (↑{ toOneHom := { toFun := _root_.id, map_one' := ?refine'_1 },
              map_mul' :=
                (_ :
                  ∀ (x y : α),
                    OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } (x * y) =
                      OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } x *
                        OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } y) })
          x +
        OneHom.toFun
          (↑{ toOneHom := { toFun := _root_.id, map_one' := ?refine'_1 },
              map_mul' :=
                (_ :
                  ∀ (x y : α),
                    OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } (x * y) =
                      OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } x *
                        OneHom.toFun { toFun := _root_.id, map_one' := ?refine'_1 } y) })
          y
[PROOFSTEP]
intros
[GOAL]
case refine'_1
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α✝
x✝ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
⊢ _root_.id 1 = 1
[PROOFSTEP]
rfl
[GOAL]
case refine'_2
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝² : NonAssocSemiring α✝
x✝¹ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
x✝ y✝ : α
⊢ OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x✝ * y✝) =
    OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } x✝ *
      OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } y✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_3
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α✝
x✝ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) },
          map_mul' :=
            (_ :
              ∀ (x y : α),
                OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y) =
                  OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y)) })
      0 =
    0
[PROOFSTEP]
rfl
[GOAL]
case refine'_4
F : Type u_1
α✝ : Type u_2
β : Type u_3
γ : Type u_4
x✝² : NonAssocSemiring α✝
x✝¹ : NonAssocSemiring β
α : Type u_5
inst✝ : NonAssocSemiring α
x✝ y✝ : α
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) },
          map_mul' :=
            (_ :
              ∀ (x y : α),
                OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y) =
                  OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y)) })
      (x✝ + y✝) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) },
            map_mul' :=
              (_ :
                ∀ (x y : α),
                  OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y) =
                    OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y)) })
        x✝ +
      OneHom.toFun
        (↑{ toOneHom := { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) },
            map_mul' :=
              (_ :
                ∀ (x y : α),
                  OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y) =
                    OneHom.toFun { toFun := _root_.id, map_one' := (_ : _root_.id 1 = _root_.id 1) } (x * y)) })
        y✝
[PROOFSTEP]
rfl
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝² : NonAssocSemiring α
x✝¹ : NonAssocSemiring β
x✝ : NonAssocSemiring γ
g : β →+* γ
f : α →+* β
src✝ : α →ₙ+* γ := NonUnitalRingHom.comp (toNonUnitalRingHom g) (toNonUnitalRingHom f)
⊢ (↑g ∘ ↑f) 1 = 1
[PROOFSTEP]
simp
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝² : NonAssocSemiring α
x✝¹ : NonAssocSemiring β
x✝ : NonAssocSemiring γ
g : β →+* γ
f₁ f₂ : α →+* β
hg : Injective ↑g
h : comp g f₁ = comp g f₂
x : α
⊢ ↑g (↑f₁ x) = ↑g (↑f₂ x)
[PROOFSTEP]
rw [← comp_apply, h, comp_apply]
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ↑f
⊢ IsDomain β
[PROOFSTEP]
haveI := pullback_nonzero f f.map_zero f.map_one
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ↑f
this : Nontrivial β
⊢ IsDomain β
[PROOFSTEP]
haveI := IsRightCancelMulZero.to_noZeroDivisors α
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ↑f
this✝ : Nontrivial β
this : NoZeroDivisors α
⊢ IsDomain β
[PROOFSTEP]
haveI := hf.noZeroDivisors f f.map_zero f.map_mul
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ↑f
this✝¹ : Nontrivial β
this✝ : NoZeroDivisors α
this : NoZeroDivisors β
⊢ IsDomain β
[PROOFSTEP]
exact NoZeroDivisors.to_isDomain β
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : CommRing α
inst✝¹ : IsDomain α
inst✝ : CommRing β
f : β →+ α
h : ∀ (x : β), ↑f (x * x) = ↑f x * ↑f x
h_two : 2 ≠ 0
h_one : ↑f 1 = 1
x y : β
⊢ OneHom.toFun { toFun := f.toFun, map_one' := h_one } (x * y) =
    OneHom.toFun { toFun := f.toFun, map_one' := h_one } x * OneHom.toFun { toFun := f.toFun, map_one' := h_one } y
[PROOFSTEP]
have hxy := h (x + y)
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : CommRing α
inst✝¹ : IsDomain α
inst✝ : CommRing β
f : β →+ α
h : ∀ (x : β), ↑f (x * x) = ↑f x * ↑f x
h_two : 2 ≠ 0
h_one : ↑f 1 = 1
x y : β
hxy : ↑f ((x + y) * (x + y)) = ↑f (x + y) * ↑f (x + y)
⊢ OneHom.toFun { toFun := f.toFun, map_one' := h_one } (x * y) =
    OneHom.toFun { toFun := f.toFun, map_one' := h_one } x * OneHom.toFun { toFun := f.toFun, map_one' := h_one } y
[PROOFSTEP]
rw [mul_add, add_mul, add_mul, f.map_add, f.map_add, f.map_add, f.map_add, h x, h y, add_mul, mul_add, mul_add, ←
  sub_eq_zero, add_comm (f x * f x + f (y * x)), ← sub_sub, ← sub_sub, ← sub_sub, mul_comm y x, mul_comm (f y) (f x)] at
  hxy
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : CommRing α
inst✝¹ : IsDomain α
inst✝ : CommRing β
f : β →+ α
h : ∀ (x : β), ↑f (x * x) = ↑f x * ↑f x
h_two : 2 ≠ 0
h_one : ↑f 1 = 1
x y : β
hxy✝ : ↑f x * ↑f x + ↑f (y * x) + (↑f (x * y) + ↑f y * ↑f y) = ↑f x * ↑f x + ↑f x * ↑f y + (↑f y * ↑f x + ↑f y * ↑f y)
hxy : ↑f (x * y) + ↑f y * ↑f y + (↑f x * ↑f x + ↑f (x * y)) - ↑f x * ↑f x - ↑f x * ↑f y - ↑f x * ↑f y - ↑f y * ↑f y = 0
⊢ OneHom.toFun { toFun := f.toFun, map_one' := h_one } (x * y) =
    OneHom.toFun { toFun := f.toFun, map_one' := h_one } x * OneHom.toFun { toFun := f.toFun, map_one' := h_one } y
[PROOFSTEP]
simp only [add_assoc, add_sub_assoc, add_sub_cancel'_right] at hxy
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : CommRing α
inst✝¹ : IsDomain α
inst✝ : CommRing β
f : β →+ α
h : ∀ (x : β), ↑f (x * x) = ↑f x * ↑f x
h_two : 2 ≠ 0
h_one : ↑f 1 = 1
x y : β
hxy✝ : ↑f x * ↑f x + ↑f (y * x) + (↑f (x * y) + ↑f y * ↑f y) = ↑f x * ↑f x + ↑f x * ↑f y + (↑f y * ↑f x + ↑f y * ↑f y)
hxy : ↑f (x * y) + (↑f (x * y) - ↑f x * ↑f y - ↑f x * ↑f y) = 0
⊢ OneHom.toFun { toFun := f.toFun, map_one' := h_one } (x * y) =
    OneHom.toFun { toFun := f.toFun, map_one' := h_one } x * OneHom.toFun { toFun := f.toFun, map_one' := h_one } y
[PROOFSTEP]
rw [sub_sub, ← two_mul, ← add_sub_assoc, ← two_mul, ← mul_sub, mul_eq_zero (M₀ := α), sub_eq_zero,
  or_iff_not_imp_left] at hxy
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : CommRing α
inst✝¹ : IsDomain α
inst✝ : CommRing β
f : β →+ α
h : ∀ (x : β), ↑f (x * x) = ↑f x * ↑f x
h_two : 2 ≠ 0
h_one : ↑f 1 = 1
x y : β
hxy✝ : ↑f x * ↑f x + ↑f (y * x) + (↑f (x * y) + ↑f y * ↑f y) = ↑f x * ↑f x + ↑f x * ↑f y + (↑f y * ↑f x + ↑f y * ↑f y)
hxy : ¬2 = 0 → ↑f (x * y) = ↑f x * ↑f y
⊢ OneHom.toFun { toFun := f.toFun, map_one' := h_one } (x * y) =
    OneHom.toFun { toFun := f.toFun, map_one' := h_one } x * OneHom.toFun { toFun := f.toFun, map_one' := h_one } y
[PROOFSTEP]
exact hxy h_two
[GOAL]
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : CommRing α
inst✝¹ : IsDomain α
inst✝ : CommRing β
f : β →+ α
h : ∀ (x : β), ↑f (x * x) = ↑f x * ↑f x
h_two : 2 ≠ 0
h_one : ↑f 1 = 1
⊢ ↑(mkRingHomOfMulSelfOfTwoNeZero f h h_two h_one) = f
[PROOFSTEP]
ext
[GOAL]
case h
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : CommRing α
inst✝¹ : IsDomain α
inst✝ : CommRing β
f : β →+ α
h : ∀ (x : β), ↑f (x * x) = ↑f x * ↑f x
h_two : 2 ≠ 0
h_one : ↑f 1 = 1
x✝ : β
⊢ ↑↑(mkRingHomOfMulSelfOfTwoNeZero f h h_two h_one) x✝ = ↑f x✝
[PROOFSTEP]
rfl