|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Yury Kudryashov. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Yury Kudryashov |
| 5 | +-/ |
| 6 | +import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex |
| 7 | + |
| 8 | +/-! |
| 9 | +# IMO 1961 Q3 |
| 10 | +
|
| 11 | +Solve the equation |
| 12 | +
|
| 13 | +$\cos^n x - \sin^n x = 1$, |
| 14 | +
|
| 15 | +where $n$ is a given positive integer. |
| 16 | +
|
| 17 | +The solution is based on the one at the |
| 18 | +[Art of Problem Solving](https://artofproblemsolving.com/wiki/index.php/1961_IMO_Problems/Problem_3) |
| 19 | +website. |
| 20 | +-/ |
| 21 | + |
| 22 | +open Real |
| 23 | + |
| 24 | +theorem Imo1961Q3 {n : ℕ} {x : ℝ} (h₀ : n ≠ 0) : |
| 25 | + (cos x) ^ n - (sin x) ^ n = 1 ↔ |
| 26 | + (∃ k : ℤ, k * π = x) ∧ Even n ∨ (∃ k : ℤ, k * (2 * π) = x) ∧ Odd n ∨ |
| 27 | + (∃ k : ℤ, -(π / 2) + k * (2 * π) = x) ∧ Odd n := by |
| 28 | + constructor |
| 29 | + · intro h |
| 30 | + rcases eq_or_ne (sin x) 0 with hsinx | hsinx |
| 31 | + · rw [hsinx, zero_pow h₀, sub_zero, pow_eq_one_iff_of_ne_zero h₀, cos_eq_one_iff, |
| 32 | + cos_eq_neg_one_iff] at h |
| 33 | + rcases h with ⟨k, rfl⟩ | ⟨⟨k, rfl⟩, hn⟩ |
| 34 | + · cases n.even_or_odd with |
| 35 | + | inl hn => refine .inl ⟨⟨k * 2, ?_⟩, hn⟩; simp [mul_assoc] |
| 36 | + | inr hn => exact .inr <| .inl ⟨⟨_, rfl⟩, hn⟩ |
| 37 | + · exact .inl ⟨⟨2 * k + 1, by push_cast; ring⟩, hn⟩ |
| 38 | + · rcases eq_or_ne (cos x) 0 with hcosx | hcosx |
| 39 | + · right; right |
| 40 | + rw [hcosx, zero_pow h₀, zero_sub, ← neg_inj, neg_neg, pow_eq_neg_one_iff, |
| 41 | + sin_eq_neg_one_iff] at h |
| 42 | + simpa only [eq_comm] using h |
| 43 | + · have hcos1 : |cos x| < 1 := by |
| 44 | + rw [abs_cos_eq_sqrt_one_sub_sin_sq, sqrt_lt' one_pos] |
| 45 | + simp [sq_pos_of_ne_zero hsinx] |
| 46 | + have hsin1 : |sin x| < 1 := by |
| 47 | + rw [abs_sin_eq_sqrt_one_sub_cos_sq, sqrt_lt' one_pos] |
| 48 | + simp [sq_pos_of_ne_zero hcosx] |
| 49 | + match n with |
| 50 | + | 1 => |
| 51 | + rw [pow_one, pow_one, sub_eq_iff_eq_add] at h |
| 52 | + have : 2 * sin x * cos x = 0 := by |
| 53 | + simpa [h, add_sq, add_assoc, ← two_mul, mul_add, mul_assoc, ← sq] |
| 54 | + using cos_sq_add_sin_sq x |
| 55 | + simp [hsinx, hcosx] at this |
| 56 | + | 2 => |
| 57 | + rw [← cos_sq_add_sin_sq x, sub_eq_add_neg, add_right_inj, neg_eq_self ℝ] at h |
| 58 | + exact absurd (pow_eq_zero h) hsinx |
| 59 | + | (n + 1 + 2) => |
| 60 | + set m := n + 1 |
| 61 | + refine absurd ?_ h.not_lt |
| 62 | + calc |
| 63 | + (cos x) ^ (m + 2) - (sin x) ^ (m + 2) ≤ |cos x| ^ (m + 2) + |sin x| ^ (m + 2) := by |
| 64 | + simp only [← abs_pow, sub_eq_add_neg] |
| 65 | + gcongr |
| 66 | + exacts [le_abs_self _, neg_le_abs _] |
| 67 | + _ = |cos x| ^ m * cos x ^ 2 + |sin x| ^ m * sin x ^ 2 := by simp [pow_add] |
| 68 | + _ < 1 ^ m * cos x ^ 2 + 1 ^ m * sin x ^ 2 := by gcongr |
| 69 | + _ = 1 := by simp |
| 70 | + · rintro (⟨⟨k, rfl⟩, hn⟩ | ⟨⟨k, rfl⟩, -⟩ | ⟨⟨k, rfl⟩, hn⟩) |
| 71 | + · rw [sin_int_mul_pi, zero_pow h₀, sub_zero, ← hn.pow_abs, abs_cos_int_mul_pi, one_pow] |
| 72 | + · have : sin (k * (2 * π)) = 0 := by simpa [mul_assoc] using sin_int_mul_pi (k * 2) |
| 73 | + simp [h₀, this] |
| 74 | + · simp [hn.neg_pow, h₀] |
0 commit comments