-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
import Mathlib
example (x : ℝ) (h : 0 ≤ x) (hn : ∀ n : ℕ, n > 0 → x ≤ 1 / n) : x = 0 := by
by_contra
have : 0 < 2 / x := (lt_div_iff₀ (by grind)).mpr (by grind)
have := hn (Nat.ceil (2 / x)) (Nat.ceil_pos.mpr this)
suffices x > 1 / (Nat.ceil (2 / x)) by linarith
have := Nat.le_ceil (2 / x)
have : 1 / x < Nat.ceil (2 / x) := by grind
have := inv_strictAnti₀ (by grind) this
field_simp at this
exact this
example (x : ℝ) (h : 0 ≤ x) (hn : ∀ n : ℕ, x ≤ 1 / n) : x = 0 := by
by_contra
have : 0 < 2 / x := (lt_div_iff₀ (by grind)).mpr (by grind)
have := hn (Nat.ceil (2 / x))
suffices x > 1 / (Nat.ceil (2 / x)) by grind
have := Nat.le_ceil (2 / x)
have : 1 / x < Nat.ceil (2 / x) := by grind
have := inv_strictAnti₀ (by grind) this
field_simp at this
exact this
example (x : ℝ) (h : 0 ≤ x) (hn : ∀ n, x ≤ 1 / n) : x = 0 := by
linarith [hn 0]
lemma blah3 (x : ℝ) (h : 0 ≤ x) (hn : ∀ n, x ≤ 1 / n) : x = 0 := by
have := hn 0
simp at this
exact le_antisymm this h
#print blah3
lemma blah4 (x : ℝ) (h : 0 ≤ x) (hn : ∀ n, x ≤ 1 / n) : x = 0 :=
le_antisymm (Eq.mp (congrArg (LE.le x) (div_zero 1)) (hn 0)) h
-- example (x : ℝ) (h : 0 ≤ x) (hn : ∀ n : ℕ, x ≤ 1 / n) : x = 0 := by
-- have h₁ : x ≤ 1 := by
-- have h₂ := hn 1
-- norm_num at h₂ ⊢
-- <;> linarith
-- have h₂ : x = 0 := by
-- by_contra h₃
-- -- We will show that if x ≠ 0, then there exists a natural number n such that x > 1 / n, contradicting hn.
-- have h₄ : 0 < x := lt_of_le_of_ne h (Ne.symm h₃)
-- -- Since x > 0, we can find a natural number n such that x > 1 / n.
-- have h₅ : ∃ n : ℕ, x > 1 / n := by
-- -- Choose n = ⌈2 / x⌉₊.
-- use ⌈(2 : ℝ) / x⌉₊
-- have h₆ : (x : ℝ) > 0 := by exact_mod_cast h₄
-- have h₇ : (⌈(2 : ℝ) / x⌉₊ : ℝ) ≥ (2 : ℝ) / x := Nat.le_ceil _
-- have h₈ : (1 : ℝ) / ⌈(2 : ℝ) / x⌉₊ ≤ 1 / ((2 : ℝ) / x) := by
-- apply one_div_le_one_div_of_le
-- · positivity
-- · linarith
-- have h₉ : (1 : ℝ) / ((2 : ℝ) / x) = x / 2 := by
-- field_simp
-- <;> ring
-- <;> field_simp
-- <;> linarith
-- have h₁₀ : (1 : ℝ) / ⌈(2 : ℝ) / x⌉₊ ≤ x / 2 := by linarith
-- have h₁₁ : x > 1 / ⌈(2 : ℝ) / x⌉₊ := by
-- have h₁₂ : (x : ℝ) > 0 := by exact_mod_cast h₄
-- have h₁₃ : (⌈(2 : ℝ) / x⌉₊ : ℝ) ≥ (2 : ℝ) / x := Nat.le_ceil _
-- have h₁₄ : (1 : ℝ) / ⌈(2 : ℝ) / x⌉₊ ≤ x / 2 := by linarith
-- have h₁₅ : x > 1 / ⌈(2 : ℝ) / x⌉₊ := by
-- by_contra h₁₆
-- have h₁₇ : (x : ℝ) ≤ 1 / ⌈(2 : ℝ) / x⌉₊ := by linarith
-- have h₁₈ : (⌈(2 : ℝ) / x⌉₊ : ℝ) ≥ (2 : ℝ) / x := Nat.le_ceil _
-- have h₁₉ : (x : ℝ) * ⌈(2 : ℝ) / x⌉₊ ≤ 1 := by
-- calc
-- (x : ℝ) * ⌈(2 : ℝ) / x⌉₊ ≤ (1 / ⌈(2 : ℝ) / x⌉₊) * ⌈(2 : ℝ) / x⌉₊ := by gcongr <;> linarith
-- _ = 1 := by field_simp [Nat.cast_ne_zero.mpr (by positivity : ⌈(2 : ℝ) / x⌉₊ ≠ 0)] <;> ring
-- have h₂₀ : (x : ℝ) * ⌈(2 : ℝ) / x⌉₊ ≥ (x : ℝ) * ((2 : ℝ) / x) := by
-- gcongr <;> linarith
-- have h₂₁ : (x : ℝ) * ((2 : ℝ) / x) = 2 := by
-- field_simp [h₆.ne']
-- <;> ring
-- <;> field_simp [h₆.ne']
-- <;> linarith
-- linarith
-- exact_mod_cast h₁₅
-- exact h₁₁
-- -- Obtain the natural number n such that x > 1 / n.
-- obtain ⟨n, hn'⟩ := h₅
-- have h₆ := hn n
-- -- This leads to a contradiction because x ≤ 1 / n by assumption, but we have x > 1 / n.
-- linarith
-- exact h₂