introvoyz041/TaoAnalysisBench huggingface dataset:
import Mathlib.Tactic
import Mathlib.Data.Rat.Basic

namespace Section_4_3

/-- Proposition 4.3.10(c) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_ge_pow (x y:ℚ) (n:ℕ) (hxy: x ≥ y) (hy: y ≥ 0) : x^n ≥ y^n := by
end Section_4_3
import Mathlib

def Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by sorry

theorem abs_of_zero : abs 0 = 0 := by sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
    sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem pow_ge_pow (x y:ℚ) (n:ℕ) (hxy: x ≥ y) (hy: y ≥ 0) : x^n ≥ y^n := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.10(c) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_ge_pow (x y : ℚ) (n : ℕ) (hxy : x ≥ y) (hy : y ≥ 0) :
    x ^ n ≥ y ^ n := by
end TaoBench
import Mathlib.Tactic

namespace Section_4_3

/-- Proposition 4.3.10(c) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_gt_pow (x y:ℚ) (n:ℕ) (hxy: x > y) (hy: y ≥ 0) (hn: n > 0) : x^n > y^n := by
end Section_4_3
import Mathlib

def Rat.Close (ε : ℚ) (x y : ℚ) := |x - y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x : ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x : ℚ} (hx : 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x : ℚ} (hx : x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x : ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y : ℚ) : dist x y = |x - y| := by
  sorry

theorem close_iff (ε x y : ℚ) : ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x : ℚ) : (0 : ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w : ℚ} (hxy : ε.Close x y) (hzw : δ.Close z w) :
    (ε * |z| + δ * |y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x : ℚ) : x ^ 0 = 1 := by
  sorry

lemma pow_succ (x : ℚ) (n : ℕ) : x ^ (n + 1) = x ^ n * x := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem pow_gt_pow (x y : ℚ) (n : ℕ) (hxy : x > y) (hy : y ≥ 0) (hn : n > 0) : x ^ n > y ^ n := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.10(c) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_gt_pow (x y : ℚ) (n : ℕ)
    (hxy : x > y) (hy : y ≥ 0) (hn : n > 0) :
    x ^ n > y ^ n := by
end TaoBench
import Mathlib.Tactic
import Mathlib.Algebra.GroupPower
import Mathlib.Data.Rat.Lemmas

namespace Section_4_3

/-- Proposition 4.3.10(a) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_mul (x:ℚ) (m n:ℕ) : (x^n)^m = x^(n*m) := by
end Section_4_3
import Mathlib

namespace Section_4_3

-- <CONTEXT>
def _root_.Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem pow_mul (x:ℚ) (m n:ℕ) : (x^n)^m = x^(n*m) := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.10(a) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_mul (x : ℚ) (m n : ℕ) : (x ^ n) ^ m = x ^ (n * m) := by
end TaoBench
import Mathlib.Tactic
import Mathlib.Data.Rat.Basic

namespace Section_4_3

/-- Proposition 4.3.10(c) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_nonneg {x:ℚ} (n:ℕ) (hx: x ≥ 0) : x^n ≥ 0 := by
end Section_4_3
import Mathlib

namespace Section_4_3

-- <CONTEXT>
def _root_.Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem pow_nonneg {x:ℚ} (n:ℕ) (hx: x ≥ 0) : x^n ≥ 0 := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.10(c) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_nonneg {x : ℚ} (n : ℕ) (hx : 0 ≤ x) : 0 ≤ x ^ n := by
end TaoBench
import Mathlib

def Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem pow_pos {x:ℚ} (n:ℕ) (hx: x > 0) : x^n > 0 := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.10(c) (Properties of exponentiation, I) / Exercise 4.3.3 -/
theorem pow_pos {x : ℚ} (n : ℕ) (hx : x > 0) : x ^ n > 0 := by
end TaoBench
import Mathlib.Data.Rat.Basic

/--
  This definition needs to be made outside of the Section 4.3 namespace for technical reasons.
-/
def Rat.Close (ε : ℚ) (x y : ℚ) := |x - y| ≤ ε

namespace Section_4_3

/-- Proposition 4.3.7(d) / Exercise 4.3.2 -/
theorem sub_close {ε δ x y z w : ℚ} (hxy : ε.Close x y) (hzw : δ.Close z w) :
    (ε + δ).Close (x - z) (y - w) := by
end Section_4_3
import Mathlib

def Rat.Close (ε : ℚ) (x y : ℚ) := |x - y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x : ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x : ℚ} (hx : 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x : ℚ} (hx : x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x : ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y : ℚ) : dist x y = |x - y| := by
  sorry

theorem close_iff (ε x y : ℚ) : ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x : ℚ) : (0 : ℚ).Close x x := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem sub_close {ε δ x y z w : ℚ} (hxy : ε.Close x y) (hzw : δ.Close z w) :
    (ε + δ).Close (x - z) (y - w) := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench
namespace Section_4_3

/-- Proposition 4.3.7(d) / Exercise 4.3.2 -/
theorem sub_close {ε δ x y z w : ℚ}
    (hxy : |x - y| ≤ ε) (hzw : |z - w| ≤ δ) :
    |(x - z) - (y - w)| ≤ ε + δ := by
end Section_4_3
end TaoBench
import Mathlib

def Rat.Close (ε : ℚ) (x y : ℚ) := |x - y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x : ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x : ℚ} (hx : 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x : ℚ} (hx : x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x : ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y : ℚ) : dist x y = |x - y| := by
  sorry

theorem close_iff (ε x y : ℚ) : ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x : ℚ) : (0 : ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w : ℚ} (hxy : ε.Close x y) (hzw : δ.Close z w) :
    (ε * |z| + δ * |y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x : ℚ) : x ^ 0 = 1 := by
  sorry

lemma pow_succ (x : ℚ) (n : ℕ) : x ^ (n + 1) = x ^ n * x := by
  sorry

theorem zpow_neg (x : ℚ) (n : ℕ) : x ^ (-(n : ℤ)) = 1 / (x ^ n) := by
  sorry

theorem pow_eq_zpow (x : ℚ) (n : ℕ) : x ^ (n : ℤ) = x ^ n := by
  sorry

theorem zpow_ge_zpow_ofneg {x y : ℚ} {n : ℤ} (hxy : x ≥ y) (hy : y > 0) (hn : n < 0) : x ^ n ≤ y ^ n := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem two_pow_geq (N : ℕ) : 2 ^ N ≥ N := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib.Algebra.GroupPower
import Mathlib.Data.Rat.Basic

namespace Section_4_3

/-- Proposition 4.3.12(d) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_abs (x:ℚ) (n:ℤ) : |x|^n = |x^n| := by
end Section_4_3
import Mathlib

def Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry

theorem zpow_neg (x:ℚ) (n:ℕ) : x^(-(n:ℤ)) = 1/(x^n) := by
  sorry

theorem pow_eq_zpow (x:ℚ) (n:ℕ): x^(n:ℤ) = x^n := by
  sorry

theorem zpow_ge_zpow_ofneg {x y:ℚ} {n:ℤ} (hxy: x ≥ y) (hy: y > 0) (hn: n < 0) : x^n ≤ y^n := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem zpow_abs (x:ℚ) (n:ℤ) : |x|^n = |x^n| := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

namespace Section_4_3

/-- Proposition 4.3.12(d) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_abs (x : ℚ) (n : ℤ) : |x| ^ n = |x ^ n| := by
end Section_4_3

end TaoBench
import Mathlib.Tactic
import Mathlib.Algebra.GroupPower

namespace Section_4_3

/-- Proposition 4.3.12(a) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_add (x:ℚ) (n m:ℤ) (hx: x ≠ 0): x^n * x^m = x^(n+m) := by
end Section_4_3
import Mathlib

namespace Section_4_3
-- <CONTEXT>
def _root_.Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry

theorem zpow_neg (x:ℚ) (n:ℕ) : x^(-(n:ℤ)) = 1/(x^n) := by
  sorry

theorem pow_eq_zpow (x:ℚ) (n:ℕ): x^(n:ℤ) = x^n := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem zpow_add (x:ℚ) (n m:ℤ) (hx: x ≠ 0): x^n * x^m = x^(n+m) := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.12(a) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_add (x : ℚ) (n m : ℤ) (hx : x ≠ 0) :
    x ^ n * x ^ m = x ^ (n + m) := by
end TaoBench
import Mathlib.Tactic
import Mathlib.Data.Rat.Basic
import Mathlib.Algebra.GroupPower
import Mathlib.Algebra.GroupWithZeroPower

namespace Section_4_3

/-- Proposition 4.3.12(b) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_ge_zpow {x y:ℚ} {n:ℤ} (hxy: x ≥ y) (hy: y > 0) (hn: n > 0): x^n ≥ y^n := by
end Section_4_3
import Mathlib

def Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry

theorem zpow_neg (x:ℚ) (n:ℕ) : x^(-(n:ℤ)) = 1/(x^n) := by
  sorry

theorem pow_eq_zpow (x:ℚ) (n:ℕ): x^(n:ℤ) = x^n := by
  sorry

theorem zpow_ge_zpow_ofneg {x y:ℚ} {n:ℤ} (hxy: x ≥ y) (hy: y > 0) (hn: n < 0) : x^n ≤ y^n := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem zpow_ge_zpow {x y:ℚ} {n:ℤ} (hxy: x ≥ y) (hy: y > 0) (hn: n > 0): x^n ≥ y^n := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.12(b) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_ge_zpow {x y : ℚ} {n : ℤ}
    (hxy : x ≥ y) (hy : y > 0) (hn : n > 0) :
    x ^ n ≥ y ^ n := by
end TaoBench
import Mathlib.Tactic
import Mathlib.Algebra.GroupPower
import Mathlib.Algebra.GroupWithZeroPower
import Mathlib.Data.Rat.Basic

namespace Section_4_3

/-- Proposition 4.3.12(c) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_inj {x y:ℚ} {n:ℤ} (hx: x > 0) (hy : y > 0) (hn: n ≠ 0) (hxy: x^n = y^n) : x = y := by
end Section_4_3
import Mathlib

namespace Section_4_3

-- <CONTEXT>
def _root_.Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry

theorem zpow_neg (x:ℚ) (n:ℕ) : x^(-(n:ℤ)) = 1/(x^n) := by
  sorry

theorem pow_eq_zpow (x:ℚ) (n:ℕ): x^(n:ℤ) = x^n := by
  sorry

theorem zpow_ge_zpow_ofneg {x y:ℚ} {n:ℤ} (hxy: x ≥ y) (hy: y > 0) (hn: n < 0) : x^n ≤ y^n := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem zpow_inj {x y:ℚ} {n:ℤ} (hx: x > 0) (hy : y > 0) (hn: n ≠ 0) (hxy: x^n = y^n) : x = y := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.12(c) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_inj {x y : ℚ} {n : ℤ} (hx : x > 0) (hy : y > 0) (hn : n ≠ 0)
    (hxy : x ^ n = y ^ n) : x = y := by
end TaoBench
import Mathlib.Data.Rat.Basic
import Mathlib.Algebra.GroupPower

namespace Section_4_3

/-- Proposition 4.3.12(a) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_mul (x:ℚ) (n m:ℤ) : (x^n)^m = x^(n*m) := by
end Section_4_3
import Mathlib

def Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry

theorem zpow_neg (x:ℚ) (n:ℕ) : x^(-(n:ℤ)) = 1/(x^n) := by
  sorry

theorem pow_eq_zpow (x:ℚ) (n:ℕ): x^(n:ℤ) = x^n := by
  sorry

-- </CONTEXT>
-- <TARGET_THEOREM>
theorem zpow_mul (x:ℚ) (n m:ℤ) : (x^n)^m = x^(n*m) := by
-- </TARGET_THEOREM>

end Section_4_3
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench

/-- Proposition 4.3.12(a) (Properties of exponentiation, II) / Exercise 4.3.4.

For rational numbers `x` and integer exponents `n, m`, iterated integer
exponentiation satisfies `(x ^ n) ^ m = x ^ (n * m)`, where `^` is the
standard `zpow` on `ℚ`. -/
theorem zpow_mul (x : ℚ) (n m : ℤ) : (x ^ n) ^ m = x ^ (n * m) := by
end TaoBench
import Mathlib.Tactic
import Mathlib.Algebra.GroupPower
import Mathlib.Data.Rat.Basic

namespace Section_4_3

/-- Proposition 4.3.12(b) (Properties of exponentiation, II) / Exercise 4.3.4 -/
theorem zpow_pos {x:ℚ} (n:ℤ) (hx: x > 0) : x^n > 0 := by
end Section_4_3
import Mathlib

def Rat.Close (ε : ℚ) (x y:ℚ) := |x-y| ≤ ε

namespace Section_4_3

-- <CONTEXT>
abbrev abs (x:ℚ) : ℚ := if x > 0 then x else (if x < 0 then -x else 0)

theorem abs_of_pos {x: ℚ} (hx: 0 < x) : abs x = x := by
  sorry

theorem abs_of_neg {x: ℚ} (hx: x < 0) : abs x = -x := by
  sorry

theorem abs_of_zero : abs 0 = 0 := by
  sorry

theorem abs_eq_abs (x: ℚ) : abs x = |x| := by
  sorry

abbrev dist (x y : ℚ) := |x - y|

theorem dist_eq (x y: ℚ) : dist x y = |x-y| := by
  sorry

theorem close_iff (ε x y:ℚ): ε.Close x y ↔ |x - y| ≤ ε := by
  sorry

theorem close_refl (x:ℚ) : (0:ℚ).Close x x := by
  sorry

theorem close_mul_mul' {ε δ x y z w:ℚ} (hxy: ε.Close x y) (hzw: δ.Close z w) :
    (ε*|z|+δ*|y|).Close (x * z) (y * w) := by
  sorry

lemma pow_zero (x:ℚ) : x^0 = 1 := by
  sorry

lemma pow_succ (x:ℚ) (n:ℕ) : x^(n+1) = x^n * x := by
  sorry

theorem zpow_neg (x:ℚ) (n:ℕ) : x^(-(n:ℤ)) = 1/(x^n) := by
  sorry

theorem pow_eq_zpow (x:ℚ) (n:ℕ): x^(n:ℤ) = x^n := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem zpow_pos {x:ℚ} (n:ℤ) (hx: x > 0) : x^n > 0 := by
  sorry
-- </TARGET_THEOREM>
theorem zpow_ge_zpow_ofneg {x y:ℚ} {n:ℤ} (hxy: x ≥ y) (hy: y > 0) (hn: n < 0) : x^n ≤ y^n := by
end Section_4_3
import Mathlib.Tactic
import Mathlib.Data.Real.Basic
import Mathlib.Topology.Basic
import Mathlib.Topology.Instances.Real
import Mathlib.Topology.UniformSpace.Basic
import Mathlib.Analysis.Calculus.Deriv

namespace Chapter9

/-- Definition 9.6.1 -/
abbrev BddOn (f:ℝ → ℝ) (X:Set ℝ) : Prop := ∃ M, ∀ x ∈ X, |f x| ≤ M

end Chapter9

open Chapter9
namespace Chapter10

/-- Exercise 10.2.7 -/
theorem _root_.UniformContinuousOn.of_lipschitz {f:ℝ → ℝ}
  (hcont: ContinuousOn f .univ)
  (hderiv: DifferentiableOn ℝ f .univ)
  (hlip: BddOn (deriv f) .univ) :
  UniformContinuousOn f (.univ) := by
end Chapter10
import Mathlib
import Analysis.Section_9_6
import Analysis.Tags.Section_9_6

namespace Chapter9

abbrev BddOn (f:ℝ → ℝ) (X:Set ℝ) : Prop := ∃ M, ∀ x ∈ X, |f x| ≤ M

end Chapter9

open Chapter9
namespace Chapter10

-- <CONTEXT>
theorem IsLocalMaxOn.iff (X:Set ℝ) (f:ℝ → ℝ) (x₀:ℝ) :
  IsLocalMaxOn f X x₀ ↔
  ∃ δ > 0, IsMaxOn f (X ∩ .Ioo (x₀ - δ) (x₀ + δ)) x₀ := by
  sorry

theorem IsLocalMinOn.iff (X:Set ℝ) (f:ℝ → ℝ) (x₀:ℝ) :
  IsLocalMinOn f X x₀ ↔
  ∃ δ > 0, IsMinOn f (X ∩ .Ioo (x₀ - δ) (x₀ + δ)) x₀ := by
  sorry

abbrev f_10_2_3 : ℝ → ℝ := fun x ↦ x^2 - x^4

theorem IsLocalMaxOn.of_restrict {X Y:Set ℝ} (hXY: Y ⊆ X) (f:ℝ → ℝ) (x₀:ℝ)
  (h: IsLocalMaxOn f X x₀) : IsLocalMaxOn f Y x₀ := by
  sorry

theorem IsLocalMinOn.of_restrict {X Y:Set ℝ} (hXY: Y ⊆ X) (f:ℝ → ℝ) (x₀:ℝ)
  (h: IsLocalMinOn f X x₀) : IsLocalMinOn f Y x₀ := by
  sorry

theorem IsMaxOn.deriv_eq_zero_counter : ∃ (a b:ℝ) (hab: a < b) (f:ℝ → ℝ)
  (x₀:ℝ) (hx₀: x₀ ∈ Set.Icc a b) (h: IsMaxOn f (.Icc a b) x₀) (L:ℝ)
  (hderiv: HasDerivWithinAt f L (.Icc a b) x₀), L ≠ 0 := by
  sorry
-- </CONTEXT>
-- <TARGET_THEOREM>
theorem _root_.UniformContinuousOn.of_lipschitz {f:ℝ → ℝ}
  (hcont: ContinuousOn f .univ)
  (hderiv: DifferentiableOn ℝ f .univ)
  (hlip: BddOn (deriv f) .univ) :
  UniformContinuousOn f (.univ) := by
-- </TARGET_THEOREM>

end Chapter10
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat Set Filter

namespace TaoBench
theorem _root_.UniformContinuousOn.of_lipschitz {f : ℝ → ℝ}
  (hcont : ContinuousOn f Set.univ)
  (hderiv : DifferentiableOn ℝ f Set.univ)
  (hlip : ∃ M : ℝ, ∀ x : ℝ, |deriv f x| ≤ M) :
  UniformContinuousOn f Set.univ := by
end TaoBench