Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Analysis/Section_4_4.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,24 @@ theorem Nat.no_infinite_descent : ¬ ∃ a:ℕ → ℕ, ∀ n, a (n+1) < a n :=

/-- Exercise 4.4.2 (b) -/
def Int.infinite_descent : Decidable (∃ a:ℕ → ℤ, ∀ n, a (n+1) < a n) := by
-- the first line of this construction should be either `apply isTrue` or `apply isFalse`.
sorry
apply isTrue
refine ⟨fun n ↦ - (n:ℤ), ?_⟩
intro n
-- simp closes -(n+1) < -n
simp

/-- Exercise 4.4.2 (b') -/
def Rat.pos_infinite_descent : Decidable (∃ a:ℕ → {x: ℚ // 0 < x}, ∀ n, a (n+1) < a n) := by
-- the first line of this construction should be either `apply isTrue` or `apply isFalse`.
sorry
apply isTrue
refine ⟨fun n ↦ ⟨(1 : ℚ) / (n + 1), by positivity⟩, ?_⟩
intro n
simp only [Subtype.mk_lt_mk]
-- goal: 1 / (↑(n + 1) + 1) < 1 / (↑n + 1)
have h1 : (0 : ℚ) < (n : ℚ) + 1 := by positivity
have h2 : (0 : ℚ) < ((n + 1 : ℕ) : ℚ) + 1 := by positivity
rw [div_lt_div_iff₀ h2 h1]
push_cast
linarith

#check even_iff_exists_two_mul
#check odd_iff_exists_bit1
Expand Down
Loading