l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem isLittleO_pi {ι : Type*} [Fintype ι] {E' : ι → Type*} [∀ i, NormedAddCommGroup (E' i)]
    {f : α → ∀ i, E' i} : f =o[l] g' ↔ ∀ i, (fun x => f x i) =o[l] g' := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
G : Type u_5
E'✝ : Type u_6
F' : Type u_7
G' : Type u_8
E'' : Type u_9
F'' : Type u_10
G'' : Type u_11
E''' : Type u_12
R : Type u_13
R' : Type u_14
𝕜 : Type u_15
𝕜' : Type u_16
inst✝¹⁵ : Norm E
inst✝¹⁴ : Norm F
inst✝¹³ : Norm G
inst✝¹² : SeminormedAddCommGroup E'✝
inst✝¹¹ : SeminormedAddCommGroup F'
inst✝¹⁰ : SeminormedAddCommGroup G'
inst✝⁹ : NormedAddCommGroup E''
inst✝⁸ : NormedAddCommGroup F''
inst✝⁷ : NormedAddCommGroup G''
inst✝⁶ : SeminormedRing R
inst✝⁵ : SeminormedAddGroup E'''
inst✝⁴ : SeminormedRing R'
inst✝³ : NormedField 𝕜
inst✝² : NormedField 𝕜'
c c' c₁ c₂ : ℝ
f✝ : α → E
g : α → F
k : α → G
f' : α → E'✝
g' : α → F'
k' : α → G'
f'' : α → E''
g'' : α → F''
k'' : α → G''
l l' : Filter α
ι : Type u_17
inst✝¹ : Fintype ι
E' : ι → Type u_18
inst✝ : (i : ι) → NormedAddCommGroup (E' i)
f : α → (i : ι) → E' i
⊢ f =o[l] g' ↔ ∀ (i : ι), (fun x => f x i) =o[l] g'

Next tactic:
simp (config := { contextual := true }) only [IsLittleO_def, isBigOWith_pi, le_of_lt]
@[simp]
theorem isLittleO_pi {ι : Type*} [Fintype ι] {E' : ι → Type*} [∀ i, NormedAddCommGroup (E' i)]
    {f : α → ∀ i, E' i} : f =o[l] g' ↔ ∀ i, (fun x => f x i) =o[l] g' := by
  simp (config := { contextual := true }) only [IsLittleO_def, isBigOWith_pi, le_of_lt]
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
G : Type u_5
E'✝ : Type u_6
F' : Type u_7
G' : Type u_8
E'' : Type u_9
F'' : Type u_10
G'' : Type u_11
E''' : Type u_12
R : Type u_13
R' : Type u_14
𝕜 : Type u_15
𝕜' : Type u_16
inst✝¹⁵ : Norm E
inst✝¹⁴ : Norm F
inst✝¹³ : Norm G
inst✝¹² : SeminormedAddCommGroup E'✝
inst✝¹¹ : SeminormedAddCommGroup F'
inst✝¹⁰ : SeminormedAddCommGroup G'
inst✝⁹ : NormedAddCommGroup E''
inst✝⁸ : NormedAddCommGroup F''
inst✝⁷ : NormedAddCommGroup G''
inst✝⁶ : SeminormedRing R
inst✝⁵ : SeminormedAddGroup E'''
inst✝⁴ : SeminormedRing R'
inst✝³ : NormedField 𝕜
inst✝² : NormedField 𝕜'
c c' c₁ c₂ : ℝ
f✝ : α → E
g : α → F
k : α → G
f' : α → E'✝
g' : α → F'
k' : α → G'
f'' : α → E''
g'' : α → F''
k'' : α → G''
l l' : Filter α
ι : Type u_17
inst✝¹ : Fintype ι
E' : ι → Type u_18
inst✝ : (i : ι) → NormedAddCommGroup (E' i)
f : α → (i : ι) → E' i
⊢ (∀ ⦃c : ℝ⦄, 0 < c → ∀ (i : ι), IsBigOWith c l (fun x => f x i) g') ↔
    ∀ (i : ι) ⦃c : ℝ⦄, 0 < c → IsBigOWith c l (fun x => f x i) g'

Next tactic:
exact ⟨fun h i c hc => h hc i, fun h c hc i => h i hc⟩
theorem isBigO_atTop_iff_eventually_exists {α : Type*} [SemilatticeSup α] [Nonempty α]
    {f : α → E} {g : α → F} : f =O[atTop] g ↔ ∀ᶠ n₀ in atTop, ∃ c, ∀ n ≥ n₀, ‖f n‖ ≤ c * ‖g n‖ := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
G : Type u_5
E' : Type u_6
F' : Type u_7
G' : Type u_8
E'' : Type u_9
F'' : Type u_10
G'' : Type u_11
E''' : Type u_12
R : Type u_13
R' : Type u_14
𝕜 : Type u_15
𝕜' : Type u_16
inst✝¹⁵ : Norm E
inst✝¹⁴ : Norm F
inst✝¹³ : Norm G
inst✝¹² : SeminormedAddCommGroup E'
inst✝¹¹ : SeminormedAddCommGroup F'
inst✝¹⁰ : SeminormedAddCommGroup G'
inst✝⁹ : NormedAddCommGroup E''
inst✝⁸ : NormedAddCommGroup F''
inst✝⁷ : NormedAddCommGroup G''
inst✝⁶ : SeminormedRing R
inst✝⁵ : SeminormedAddGroup E'''
inst✝⁴ : SeminormedRing R'
inst✝³ : NormedField 𝕜
inst✝² : NormedField 𝕜'
c c' c₁ c₂ : ℝ
f✝ : α✝ → E
g✝ : α✝ → F
k : α✝ → G
f' : α✝ → E'
g' : α✝ → F'
k' : α✝ → G'
f'' : α✝ → E''
g'' : α✝ → F''
k'' : α✝ → G''
l l' : Filter α✝
α : Type u_17
inst✝¹ : SemilatticeSup α
inst✝ : Nonempty α
f : α → E
g : α → F
⊢ f =O[atTop] g ↔ ∀ᶠ (n₀ : α) in atTop, ∃ c, ∀ n ≥ n₀, ‖f n‖ ≤ c * ‖g n‖

Next tactic:
rw [isBigO_iff, exists_eventually_atTop]
theorem isBigO_atTop_iff_eventually_exists_pos {α : Type*}
    [SemilatticeSup α] [Nonempty α] {f : α → G} {g : α → G'} :
    f =O[atTop] g ↔ ∀ᶠ n₀ in atTop, ∃ c > 0, ∀ n ≥ n₀, c * ‖f n‖ ≤ ‖g n‖ := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
G : Type u_5
E' : Type u_6
F' : Type u_7
G' : Type u_8
E'' : Type u_9
F'' : Type u_10
G'' : Type u_11
E''' : Type u_12
R : Type u_13
R' : Type u_14
𝕜 : Type u_15
𝕜' : Type u_16
inst✝¹⁵ : Norm E
inst✝¹⁴ : Norm F
inst✝¹³ : Norm G
inst✝¹² : SeminormedAddCommGroup E'
inst✝¹¹ : SeminormedAddCommGroup F'
inst✝¹⁰ : SeminormedAddCommGroup G'
inst✝⁹ : NormedAddCommGroup E''
inst✝⁸ : NormedAddCommGroup F''
inst✝⁷ : NormedAddCommGroup G''
inst✝⁶ : SeminormedRing R
inst✝⁵ : SeminormedAddGroup E'''
inst✝⁴ : SeminormedRing R'
inst✝³ : NormedField 𝕜
inst✝² : NormedField 𝕜'
c c' c₁ c₂ : ℝ
f✝ : α✝ → E
g✝ : α✝ → F
k : α✝ → G
f' : α✝ → E'
g' : α✝ → F'
k' : α✝ → G'
f'' : α✝ → E''
g'' : α✝ → F''
k'' : α✝ → G''
l l' : Filter α✝
α : Type u_17
inst✝¹ : SemilatticeSup α
inst✝ : Nonempty α
f : α → G
g : α → G'
⊢ f =O[atTop] g ↔ ∀ᶠ (n₀ : α) in atTop, ∃ c > 0, ∀ n ≥ n₀, c * ‖f n‖ ≤ ‖g n‖

Next tactic:
simp_rw [isBigO_iff'', ← exists_prop, Subtype.exists', exists_eventually_atTop]
/-- Transfer `IsBigOWith` over a `PartialHomeomorph`. -/
theorem isBigOWith_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} {C : ℝ} : IsBigOWith C (𝓝 b) f g ↔ IsBigOWith C (𝓝 (e.symm b)) (f ∘ e) (g ∘ e) :=
  ⟨fun h =>
    h.comp_tendsto <| by
      

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : PartialHomeomorph α β
b : β
hb : b ∈ e.target
f : β → E
g : β → F
C : ℝ
h : IsBigOWith C (𝓝 b) f g
⊢ Tendsto (↑e) (𝓝 (↑(PartialHomeomorph.symm e) b)) (𝓝 b)

Next tactic:
have := e.continuousAt (e.map_target hb)
/-- Transfer `IsBigOWith` over a `PartialHomeomorph`. -/
theorem isBigOWith_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} {C : ℝ} : IsBigOWith C (𝓝 b) f g ↔ IsBigOWith C (𝓝 (e.symm b)) (f ∘ e) (g ∘ e) :=
  ⟨fun h =>
    h.comp_tendsto <| by
      have := e.continuousAt (e.map_target hb)
      

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : PartialHomeomorph α β
b : β
hb : b ∈ e.target
f : β → E
g : β → F
C : ℝ
h : IsBigOWith C (𝓝 b) f g
this : ContinuousAt (↑e) (↑(PartialHomeomorph.symm e) b)
⊢ Tendsto (↑e) (𝓝 (↑(PartialHomeomorph.symm e) b)) (𝓝 b)

Next tactic:
rwa [ContinuousAt, e.rightInvOn hb] at this
/-- Transfer `IsBigO` over a `PartialHomeomorph`. -/
theorem isBigO_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} : f =O[𝓝 b] g ↔ (f ∘ e) =O[𝓝 (e.symm b)] (g ∘ e) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : PartialHomeomorph α β
b : β
hb : b ∈ e.target
f : β → E
g : β → F
⊢ f =O[𝓝 b] g ↔ (f ∘ ↑e) =O[𝓝 (↑(PartialHomeomorph.symm e) b)] (g ∘ ↑e)

Next tactic:
simp only [IsBigO_def]
/-- Transfer `IsBigO` over a `PartialHomeomorph`. -/
theorem isBigO_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} : f =O[𝓝 b] g ↔ (f ∘ e) =O[𝓝 (e.symm b)] (g ∘ e) := by
  simp only [IsBigO_def]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : PartialHomeomorph α β
b : β
hb : b ∈ e.target
f : β → E
g : β → F
⊢ (∃ c, IsBigOWith c (𝓝 b) f g) ↔ ∃ c, IsBigOWith c (𝓝 (↑(PartialHomeomorph.symm e) b)) (f ∘ ↑e) (g ∘ ↑e)

Next tactic:
exact exists_congr fun C => e.isBigOWith_congr hb
/-- Transfer `IsLittleO` over a `PartialHomeomorph`. -/
theorem isLittleO_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} : f =o[𝓝 b] g ↔ (f ∘ e) =o[𝓝 (e.symm b)] (g ∘ e) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : PartialHomeomorph α β
b : β
hb : b ∈ e.target
f : β → E
g : β → F
⊢ f =o[𝓝 b] g ↔ (f ∘ ↑e) =o[𝓝 (↑(PartialHomeomorph.symm e) b)] (g ∘ ↑e)

Next tactic:
simp only [IsLittleO_def]
/-- Transfer `IsLittleO` over a `PartialHomeomorph`. -/
theorem isLittleO_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} : f =o[𝓝 b] g ↔ (f ∘ e) =o[𝓝 (e.symm b)] (g ∘ e) := by
  simp only [IsLittleO_def]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : PartialHomeomorph α β
b : β
hb : b ∈ e.target
f : β → E
g : β → F
⊢ (∀ ⦃c : ℝ⦄, 0 < c → IsBigOWith c (𝓝 b) f g) ↔
    ∀ ⦃c : ℝ⦄, 0 < c → IsBigOWith c (𝓝 (↑(PartialHomeomorph.symm e) b)) (f ∘ ↑e) (g ∘ ↑e)

Next tactic:
exact forall₂_congr fun c _hc => e.isBigOWith_congr hb
/-- Transfer `IsBigO` over a `Homeomorph`. -/
theorem isBigO_congr (e : α ≃ₜ β) {b : β} {f : β → E} {g : β → F} :
    f =O[𝓝 b] g ↔ (f ∘ e) =O[𝓝 (e.symm b)] (g ∘ e) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : α ≃ₜ β
b : β
f : β → E
g : β → F
⊢ f =O[𝓝 b] g ↔ (f ∘ ⇑e) =O[𝓝 ((Homeomorph.symm e) b)] (g ∘ ⇑e)

Next tactic:
simp only [IsBigO_def]
/-- Transfer `IsBigO` over a `Homeomorph`. -/
theorem isBigO_congr (e : α ≃ₜ β) {b : β} {f : β → E} {g : β → F} :
    f =O[𝓝 b] g ↔ (f ∘ e) =O[𝓝 (e.symm b)] (g ∘ e) := by
  simp only [IsBigO_def]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : α ≃ₜ β
b : β
f : β → E
g : β → F
⊢ (∃ c, IsBigOWith c (𝓝 b) f g) ↔ ∃ c, IsBigOWith c (𝓝 ((Homeomorph.symm e) b)) (f ∘ ⇑e) (g ∘ ⇑e)

Next tactic:
exact exists_congr fun C => e.isBigOWith_congr
/-- Transfer `IsLittleO` over a `Homeomorph`. -/
theorem isLittleO_congr (e : α ≃ₜ β) {b : β} {f : β → E} {g : β → F} :
    f =o[𝓝 b] g ↔ (f ∘ e) =o[𝓝 (e.symm b)] (g ∘ e) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : α ≃ₜ β
b : β
f : β → E
g : β → F
⊢ f =o[𝓝 b] g ↔ (f ∘ ⇑e) =o[𝓝 ((Homeomorph.symm e) b)] (g ∘ ⇑e)

Next tactic:
simp only [IsLittleO_def]
/-- Transfer `IsLittleO` over a `Homeomorph`. -/
theorem isLittleO_congr (e : α ≃ₜ β) {b : β} {f : β → E} {g : β → F} :
    f =o[𝓝 b] g ↔ (f ∘ e) =o[𝓝 (e.symm b)] (g ∘ e) := by
  simp only [IsLittleO_def]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
E : Type u_3
inst✝¹ : Norm E
F : Type u_4
inst✝ : Norm F
e : α ≃ₜ β
b : β
f : β → E
g : β → F
⊢ (∀ ⦃c : ℝ⦄, 0 < c → IsBigOWith c (𝓝 b) f g) ↔
    ∀ ⦃c : ℝ⦄, 0 < c → IsBigOWith c (𝓝 ((Homeomorph.symm e) b)) (f ∘ ⇑e) (g ∘ ⇑e)

Next tactic:
exact forall₂_congr fun c _hc => e.isBigOWith_congr
@[to_additive]
instance mulOneClass [MulOneClass α] : MulOneClass (ULift α) :=
  Equiv.ulift.injective.mulOneClass _ rfl (by 

Proof state:
α : Type u
β : Type u_1
x y : ULift.{v, u} α
inst✝ : MulOneClass α
⊢ ∀ (x y : ULift.{?u.3830, u} α), Equiv.ulift (x * y) = Equiv.ulift x * Equiv.ulift y

Next tactic:
intros
@[to_additive]
instance mulOneClass [MulOneClass α] : MulOneClass (ULift α) :=
  Equiv.ulift.injective.mulOneClass _ rfl (by intros; 

Proof state:
α : Type u
β : Type u_1
x y : ULift.{v, u} α
inst✝ : MulOneClass α
x✝ y✝ : ULift.{?u.3830, u} α
⊢ Equiv.ulift (x✝ * y✝) = Equiv.ulift x✝ * Equiv.ulift y✝

Next tactic:
rfl
instance mulZeroOneClass [MulZeroOneClass α] : MulZeroOneClass (ULift α) :=
  Equiv.ulift.injective.mulZeroOneClass _ rfl rfl (by 

Proof state:
α : Type u
β : Type u_1
x y : ULift.{v, u} α
inst✝ : MulZeroOneClass α
⊢ ∀ (a b : ULift.{?u.4396, u} α), Equiv.ulift (a * b) = Equiv.ulift a * Equiv.ulift b

Next tactic:
intros
instance mulZeroOneClass [MulZeroOneClass α] : MulZeroOneClass (ULift α) :=
  Equiv.ulift.injective.mulZeroOneClass _ rfl rfl (by intros; 

Proof state:
α : Type u
β : Type u_1
x y : ULift.{v, u} α
inst✝ : MulZeroOneClass α
a✝ b✝ : ULift.{?u.4396, u} α
⊢ Equiv.ulift (a✝ * b✝) = Equiv.ulift a✝ * Equiv.ulift b✝

Next tactic:
rfl
instance noMaxOrder [PartialOrder α] [NoMaxOrder α] {a : α} : NoMaxOrder { x : α // a ≤ x } :=
  show NoMaxOrder (Ici a) by 

Proof state:
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : NoMaxOrder α
a : α
⊢ NoMaxOrder ↑(Ici a)

Next tactic:
infer_instance
/-- If `sSup ∅ ≤ a` then `{x : α // a ≤ x}` is a `ConditionallyCompleteLinearOrderBot`.

This instance uses data fields from `Subtype.linearOrder` to help type-class inference.
The `Set.Ici` data fields are definitionally equal, but that requires unfolding semireducible
definitions, so type-class inference won't see this. -/
@[reducible]
protected noncomputable def conditionallyCompleteLinearOrderBot [ConditionallyCompleteLinearOrder α]
    (a : α) : ConditionallyCompleteLinearOrderBot { x : α // a ≤ x } :=
  { Nonneg.orderBot, Nonneg.conditionallyCompleteLinearOrder with
    csSup_empty := by
      

Proof state:
α : Type u_1
inst✝ : ConditionallyCompleteLinearOrder α
a : α
src✝¹ : OrderBot { x // a ≤ x } := orderBot
src✝ : ConditionallyCompleteLinearOrder { x // a ≤ x } := Nonneg.conditionallyCompleteLinearOrder
⊢ sSup ∅ = ⊥

Next tactic:
rw [@subset_sSup_def α (Set.Ici a) _ _ ⟨⟨a, le_rfl⟩⟩]
/-- If `sSup ∅ ≤ a` then `{x : α // a ≤ x}` is a `ConditionallyCompleteLinearOrderBot`.

This instance uses data fields from `Subtype.linearOrder` to help type-class inference.
The `Set.Ici` data fields are definitionally equal, but that requires unfolding semireducible
definitions, so type-class inference won't see this. -/
@[reducible]
protected noncomputable def conditionallyCompleteLinearOrderBot [ConditionallyCompleteLinearOrder α]
    (a : α) : ConditionallyCompleteLinearOrderBot { x : α // a ≤ x } :=
  { Nonneg.orderBot, Nonneg.conditionallyCompleteLinearOrder with
    csSup_empty := by
      rw [@subset_sSup_def α (Set.Ici a) _ _ ⟨⟨a, le_rfl⟩⟩]; 

Proof state:
α : Type u_1
inst✝ : ConditionallyCompleteLinearOrder α
a : α
src✝¹ : OrderBot { x // a ≤ x } := orderBot
src✝ : ConditionallyCompleteLinearOrder { x // a ≤ x } := Nonneg.conditionallyCompleteLinearOrder
⊢ (fun t =>
        if ht : Set.Nonempty t ∧ BddAbove t ∧ sSup (Subtype.val '' t) ∈ Ici a then
          { val := sSup (Subtype.val '' t), property := (_ : sSup (Subtype.val '' t) ∈ Ici a) }
        else default)
      ∅ =
    ⊥

Next tactic:
simp [bot_eq]
instance addMonoidWithOne [OrderedSemiring α] : AddMonoidWithOne { x : α // 0 ≤ x } :=
  { Nonneg.one,
    Nonneg.orderedAddCommMonoid with
    natCast := fun n => ⟨n, Nat.cast_nonneg n⟩
    natCast_zero := by 

Proof state:
α : Type u_1
inst✝ : OrderedSemiring α
src✝¹ : One { x // 0 ≤ x } := one
src✝ : OrderedAddCommMonoid { x // 0 ≤ x } := orderedAddCommMonoid
⊢ NatCast.natCast 0 = 0

Next tactic:
simp
instance addMonoidWithOne [OrderedSemiring α] : AddMonoidWithOne { x : α // 0 ≤ x } :=
  { Nonneg.one,
    Nonneg.orderedAddCommMonoid with
    natCast := fun n => ⟨n, Nat.cast_nonneg n⟩
    natCast_zero := by simp
    natCast_succ := fun _ => by 

Proof state:
α : Type u_1
inst✝ : OrderedSemiring α
src✝¹ : One { x // 0 ≤ x } := one
src✝ : OrderedAddCommMonoid { x // 0 ≤ x } := orderedAddCommMonoid
x✝ : ℕ
⊢ NatCast.natCast (x✝ + 1) = NatCast.natCast x✝ + 1

Next tactic:
simp
instance addMonoidWithOne [OrderedSemiring α] : AddMonoidWithOne { x : α // 0 ≤ x } :=
  { Nonneg.one,
    Nonneg.orderedAddCommMonoid with
    natCast := fun n => ⟨n, Nat.cast_nonneg n⟩
    natCast_zero := by simp
    natCast_succ := fun _ => by simp; 

Proof state:
α : Type u_1
inst✝ : OrderedSemiring α
src✝¹ : One { x // 0 ≤ x } := one
src✝ : OrderedAddCommMonoid { x // 0 ≤ x } := orderedAddCommMonoid
x✝ : ℕ
⊢ { val := ↑x✝ + 1, property := (_ : (fun x => 0 ≤ x) (↑x✝ + 1)) } = { val := ↑x✝, property := (_ : 0 ≤ ↑x✝) } + 1

Next tactic:
rfl
instance monoidWithZero [OrderedSemiring α] : MonoidWithZero { x : α // 0 ≤ x } := by 

Proof state:
α : Type u_1
inst✝ : OrderedSemiring α
⊢ MonoidWithZero { x // 0 ≤ x }

Next tactic:
infer_instance
instance commMonoidWithZero [OrderedCommSemiring α] : CommMonoidWithZero { x : α // 0 ≤ x } := by
  

Proof state:
α : Type u_1
inst✝ : OrderedCommSemiring α
⊢ CommMonoidWithZero { x // 0 ≤ x }

Next tactic:
infer_instance
instance canonicallyOrderedCommSemiring [OrderedCommRing α] [NoZeroDivisors α] :
    CanonicallyOrderedCommSemiring { x : α // 0 ≤ x } :=
  { Nonneg.canonicallyOrderedAddCommMonoid, Nonneg.orderedCommSemiring with
    eq_zero_or_eq_zero_of_mul_eq_zero := by
      

Proof state:
α : Type u_1
inst✝¹ : OrderedCommRing α
inst✝ : NoZeroDivisors α
src✝¹ : CanonicallyOrderedAddCommMonoid { x // 0 ≤ x } := canonicallyOrderedAddCommMonoid
src✝ : OrderedCommSemiring { x // 0 ≤ x } := orderedCommSemiring
⊢ ∀ {a b : { x // 0 ≤ x }}, a * b = 0 → a = 0 ∨ b = 0

Next tactic:
rintro ⟨a, ha⟩ ⟨b, hb⟩
instance canonicallyOrderedCommSemiring [OrderedCommRing α] [NoZeroDivisors α] :
    CanonicallyOrderedCommSemiring { x : α // 0 ≤ x } :=
  { Nonneg.canonicallyOrderedAddCommMonoid, Nonneg.orderedCommSemiring with
    eq_zero_or_eq_zero_of_mul_eq_zero := by
      rintro ⟨a, ha⟩ ⟨b, hb⟩
      

Proof state:
case mk.mk
α : Type u_1
inst✝¹ : OrderedCommRing α
inst✝ : NoZeroDivisors α
src✝¹ : CanonicallyOrderedAddCommMonoid { x // 0 ≤ x } := canonicallyOrderedAddCommMonoid
src✝ : OrderedCommSemiring { x // 0 ≤ x } := orderedCommSemiring
a : α
ha : 0 ≤ a
b : α
hb : 0 ≤ b
⊢ { val := a, property := ha } * { val := b, property := hb } = 0 →
    { val := a, property := ha } = 0 ∨ { val := b, property := hb } = 0

Next tactic:
simp only [mk_mul_mk, mk_eq_zero, mul_eq_zero, imp_self]
@[simp]
theorem toNonneg_of_nonneg {a : α} (h : 0 ≤ a) : toNonneg a = ⟨a, h⟩ := by 

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : 0 ≤ a
⊢ toNonneg a = { val := a, property := h }

Next tactic:
simp [toNonneg, h]
@[simp]
theorem toNonneg_le {a : α} {b : { x : α // 0 ≤ x }} : toNonneg a ≤ b ↔ a ≤ b := by
  

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
b : { x // 0 ≤ x }
⊢ toNonneg a ≤ b ↔ a ≤ ↑b

Next tactic:
cases' b with b hb
@[simp]
theorem toNonneg_le {a : α} {b : { x : α // 0 ≤ x }} : toNonneg a ≤ b ↔ a ≤ b := by
  cases' b with b hb
  

Proof state:
case mk
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a b : α
hb : 0 ≤ b
⊢ toNonneg a ≤ { val := b, property := hb } ↔ a ≤ ↑{ val := b, property := hb }

Next tactic:
simp [toNonneg, hb]
@[simp]
theorem toNonneg_lt {a : { x : α // 0 ≤ x }} {b : α} : a < toNonneg b ↔ ↑a < b := by
  

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : { x // 0 ≤ x }
b : α
⊢ a < toNonneg b ↔ ↑a < b

Next tactic:
cases' a with a ha
@[simp]
theorem toNonneg_lt {a : { x : α // 0 ≤ x }} {b : α} : a < toNonneg b ↔ ↑a < b := by
  cases' a with a ha
  

Proof state:
case mk
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
b a : α
ha : 0 ≤ a
⊢ { val := a, property := ha } < toNonneg b ↔ ↑{ val := a, property := ha } < b

Next tactic:
simp [toNonneg, ha.not_lt]
instance orderedSub [LinearOrderedRing α] : OrderedSub { x : α // 0 ≤ x } :=
  ⟨by
    

Proof state:
α : Type u_1
inst✝ : LinearOrderedRing α
⊢ ∀ (a b c : { x // 0 ≤ x }), a - b ≤ c ↔ a ≤ c + b

Next tactic:
rintro ⟨a, ha⟩ ⟨b, hb⟩ ⟨c, hc⟩
instance orderedSub [LinearOrderedRing α] : OrderedSub { x : α // 0 ≤ x } :=
  ⟨by
    rintro ⟨a, ha⟩ ⟨b, hb⟩ ⟨c, hc⟩
    

Proof state:
case mk.mk.mk
α : Type u_1
inst✝ : LinearOrderedRing α
a : α
ha : 0 ≤ a
b : α
hb : 0 ≤ b
c : α
hc : 0 ≤ c
⊢ { val := a, property := ha } - { val := b, property := hb } ≤ { val := c, property := hc } ↔
    { val := a, property := ha } ≤ { val := c, property := hc } + { val := b, property := hb }

Next tactic:
simp only [sub_le_iff_le_add, Subtype.mk_le_mk, mk_sub_mk, mk_add_mk, toNonneg_le,
      Subtype.coe_mk]
theorem log_mul_self_monotoneOn : MonotoneOn (fun x : ℝ => log x * x) { x | 1 ≤ x } := by
  -- TODO: can be strengthened to exp (-1) ≤ x
  

Proof state:
x y : ℝ
⊢ MonotoneOn (fun x => log x * x) {x | 1 ≤ x}

Next tactic:
simp only [MonotoneOn, mem_setOf_eq]
theorem log_mul_self_monotoneOn : MonotoneOn (fun x : ℝ => log x * x) { x | 1 ≤ x } := by
  -- TODO: can be strengthened to exp (-1) ≤ x
  simp only [MonotoneOn, mem_setOf_eq]
  

Proof state:
x y : ℝ
⊢ ∀ ⦃a : ℝ⦄, 1 ≤ a → ∀ ⦃b : ℝ⦄, 1 ≤ b → a ≤ b → log a * a ≤ log b * b

Next tactic:
intro x hex y hey hxy
theorem log_mul_self_monotoneOn : MonotoneOn (fun x : ℝ => log x * x) { x | 1 ≤ x } := by
  -- TODO: can be strengthened to exp (-1) ≤ x
  simp only [MonotoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  

Proof state:
x✝ y✝ x : ℝ
hex : 1 ≤ x
y : ℝ
hey : 1 ≤ y
hxy : x ≤ y
⊢ log x * x ≤ log y * y

Next tactic:
have y_pos : 0 < y := lt_of_lt_of_le zero_lt_one hey
theorem log_mul_self_monotoneOn : MonotoneOn (fun x : ℝ => log x * x) { x | 1 ≤ x } := by
  -- TODO: can be strengthened to exp (-1) ≤ x
  simp only [MonotoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  have y_pos : 0 < y := lt_of_lt_of_le zero_lt_one hey
  

Proof state:
x✝ y✝ x : ℝ
hex : 1 ≤ x
y : ℝ
hey : 1 ≤ y
hxy : x ≤ y
y_pos : 0 < y
⊢ log x * x ≤ log y * y

Next tactic:
gcongr
theorem log_mul_self_monotoneOn : MonotoneOn (fun x : ℝ => log x * x) { x | 1 ≤ x } := by
  -- TODO: can be strengthened to exp (-1) ≤ x
  simp only [MonotoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  have y_pos : 0 < y := lt_of_lt_of_le zero_lt_one hey
  gcongr
  

Proof state:
case b0
x✝ y✝ x : ℝ
hex : 1 ≤ x
y : ℝ
hey : 1 ≤ y
hxy : x ≤ y
y_pos : 0 < y
⊢ 0 ≤ log y

Next tactic:
rwa [le_log_iff_exp_le y_pos, Real.exp_zero]
theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | exp 1 ≤ x } := by
  

Proof state:
x y : ℝ
⊢ AntitoneOn (fun x => log x / x) {x | rexp 1 ≤ x}

Next tactic:
simp only [AntitoneOn, mem_setOf_eq]
theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | exp 1 ≤ x } := by
  simp only [AntitoneOn, mem_setOf_eq]
  

Proof state:
x y : ℝ
⊢ ∀ ⦃a : ℝ⦄, rexp 1 ≤ a → ∀ ⦃b : ℝ⦄, rexp 1 ≤ b → a ≤ b → log b / b ≤ log a / a

Next tactic:
intro x hex y hey hxy
theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | exp 1 ≤ x } := by
  simp only [AntitoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  

Proof state:
x✝ y✝ x : ℝ
hex : rexp 1 ≤ x
y : ℝ
hey : rexp 1 ≤ y
hxy : x ≤ y
⊢ log y / y ≤ log x / x

Next tactic:
have x_pos : 0 < x := (exp_pos 1).trans_le hex
theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | exp 1 ≤ x } := by
  simp only [AntitoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  have x_pos : 0 < x := (exp_pos 1).trans_le hex
  

Proof state:
x✝ y✝ x : ℝ
hex : rexp 1 ≤ x
y : ℝ
hey : rexp 1 ≤ y
hxy : x ≤ y
x_pos : 0 < x
⊢ log y / y ≤ log x / x

Next tactic:
have y_pos : 0 < y := (exp_pos 1).trans_le hey
theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | exp 1 ≤ x } := by
  simp only [AntitoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  have x_pos : 0 < x := (exp_pos 1).trans_le hex
  have y_pos : 0 < y := (exp_pos 1).trans_le hey
  

Proof state:
x✝ y✝ x : ℝ
hex : rexp 1 ≤ x
y : ℝ
hey : rexp 1 ≤ y
hxy : x ≤ y
x_pos : 0 < x
y_pos : 0 < y
⊢ log y / y ≤ log x / x

Next tactic:
have hlogx : 1 ≤ log x := by rwa [le_log_iff_exp_le x_pos]
theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | exp 1 ≤ x } := by
  simp only [AntitoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  have x_pos : 0 < x := (exp_pos 1).trans_le hex
  have y_pos : 0 < y := (exp_pos 1).trans_le hey
  have hlogx : 1 ≤ log x := by 

Proof state:
x✝ y✝ x : ℝ
hex : rexp 1 ≤ x
y : ℝ
hey : rexp 1 ≤ y
hxy : x ≤ y
x_pos : 0 < x
y_pos : 0 < y
⊢ 1 ≤ log x

Next tactic:
rwa [le_log_iff_exp_le x_pos]
theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | exp 1 ≤ x } := by
  simp only [AntitoneOn, mem_setOf_eq]
  intro x hex y hey hxy
  have x_pos : 0 < x := (exp_pos 1).trans_le hex
  have y_pos : 0 < y := (exp_pos 1).trans_le hey
  have hlogx : 1 ≤ log x := by rwa [le_log_iff_exp_le x_pos]
  

Proof state:
x✝ y✝ x : ℝ
hex : rexp 1 ≤ x
y : ℝ
hey : rexp 1 ≤ y
hxy : x ≤ y
x_pos : 0 < x
y_pos : 0 < y
hlogx : 1 ≤ log x
⊢ log y / y ≤ log x / x

Next tactic:
have hyx : 0 ≤ y / x - 1 := by rwa [le_sub_iff_add_le, le_div_iff x_pos, zero_add, one_mul]