Skip to content

Commit de2c4a0

Browse files
committed
pointwise birkhoff theorem
2 parents 92535e7 + 5acb9ea commit de2c4a0

2,351 files changed

Lines changed: 17645 additions & 9693 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Archive/Examples/Eisenstein.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ example : Irreducible (X ^ 4 - 10 * X ^ 2 + 1 : ℤ[X]) := by
5959
CharP.ker_intAlgebraMap_eq_span 3, span_singleton_pow, mem_span_singleton]
6060
norm_num
6161
rw [hfq, ← modByMonicHom_apply, map_add]
62-
convert zero_add _
62+
convert! zero_add _
6363
· rw [← LinearMap.mem_ker, mem_ker_modByMonic hq_monic]
6464
rw [pow_two, ← sub_mul]
6565
apply dvd_mul_left

Archive/Imo/Imo1959Q2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ theorem sqrt_two_mul_sub_one_le_one : sqrt (2 * x - 1) ≤ 1 ↔ x ≤ 1 := by
6060
theorem isGood_iff_eq_sqrt_two (hx : x ∈ Icc (1 / 2) 1) : IsGood x A ↔ A = sqrt 2 := by
6161
have : sqrt (2 * x - 1) ≤ 1 := sqrt_two_mul_sub_one_le_one.2 hx.2
6262
simp only [isGood_iff, hx.1, abs_sub_comm _ (1 : ℝ), abs_of_nonneg (sub_nonneg.2 this), and_true]
63-
suffices 2 = A * sqrt 2 ↔ A = sqrt 2 by convert this using 2; ring
63+
suffices 2 = A * sqrt 2 ↔ A = sqrt 2 by convert! this using 2; ring
6464
rw [← div_eq_iff, div_sqrt, eq_comm]
6565
positivity
6666

Archive/Imo/Imo1982Q3.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ end Imo1982Q3
7474
theorem imo1982_q3a (hx : Antitone x) (h0 : x 0 = 1) (hp : ∀ k, 0 < x k) :
7575
∃ n : ℕ, 3.999 ≤ ∑ k ∈ range n, (x k) ^ 2 / x (k + 1) := by
7676
use 4000
77-
convert Imo1982Q3.ineq (Nat.succ_ne_zero 3998) hx h0 hp
77+
convert! Imo1982Q3.ineq (Nat.succ_ne_zero 3998) hx h0 hp
7878
norm_num
7979

8080
/-- Part b of the problem is solved by `x k = (1 / 2) ^ k`. -/
@@ -88,6 +88,6 @@ theorem imo1982_q3b : ∃ x : ℕ → ℝ, Antitone x ∧ x 0 = 1 ∧ (∀ k, 0
8888
simp_rw [← pow_mul, pow_succ, ← div_eq_mul_inv, div_div_eq_mul_div, mul_comm, mul_div_assoc,
8989
← mul_sum, div_eq_mul_inv, this, ← two_add_two_eq_four, ← mul_two,
9090
mul_lt_mul_iff_of_pos_left two_pos]
91-
convert NNReal.coe_lt_coe.2 <| geom_sum_lt (inv_ne_zero two_ne_zero) two_inv_lt_one n
91+
convert! NNReal.coe_lt_coe.2 <| geom_sum_lt (inv_ne_zero two_ne_zero) two_inv_lt_one n
9292
· simp
9393
· norm_num

Archive/Imo/Imo1994Q1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ theorem imo1994_q1 (n : ℕ) (m : ℕ) (A : Finset ℕ) (hm : #A = m + 1)
5454
-- `i ↦ m-i`
5555
-- We reindex the sum by fin (m+1)
5656
have : ∑ x ∈ A, x = ∑ i : Fin (m + 1), a i := by
57-
convert sum_image fun x _ y _ => a.eq_iff_eq.1
57+
convert! sum_image fun x _ y _ => a.eq_iff_eq.1
5858
rw [← coe_inj]; simp [a]
5959
rw [this]; clear this
6060
-- The main proof is a simple calculation by rearranging one of the two sums

Archive/Imo/Imo1998Q2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ end
210210
theorem clear_denominators {a b k : ℕ} (ha : 0 < a) (hb : 0 < b) :
211211
(b - 1 : ℚ) / (2 * b) ≤ k / a ↔ ((b : ℕ) - 1) * a ≤ k * (2 * b) := by
212212
rw [div_le_div_iff₀]
213-
on_goal 1 => convert Nat.cast_le (α := ℚ)
213+
on_goal 1 => convert! Nat.cast_le (α := ℚ)
214214
all_goals simp [ha, hb]
215215

216216
end

Archive/Imo/Imo2001Q5.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ lemma x_pos : 0 < s.x := by
104104
have col := s.ABC_eq; rw [h, mul_zero] at col
105105
replace col : Collinear ℝ {s.A, s.B, s.C} := by
106106
apply collinear_of_sin_eq_zero; rw [col, Real.sin_zero]
107-
apply s.not_collinear_BAC; convert col using 1; grind
107+
apply s.not_collinear_BAC; convert! col using 1; grind
108108

109109
lemma Q_ne_A : s.Q ≠ s.A := by
110110
by_contra h; have := s.ABQ_eq
@@ -127,7 +127,7 @@ lemma x_lt_pi_div_three : s.x < π / 3 := by
127127
have col : ∠ s.A s.C s.B = 0 := by linarith [s.ACB_eq, angle_nonneg s.A s.C s.B]
128128
replace col : Collinear ℝ {s.A, s.C, s.B} := by
129129
apply collinear_of_sin_eq_zero; rw [col, Real.sin_zero]
130-
apply s.not_collinear_BAC; convert col using 1; grind
130+
apply s.not_collinear_BAC; convert! col using 1; grind
131131

132132
lemma APB_eq : ∠ s.A s.P s.B = 5 * π / 6 - 2 * s.x := by
133133
have := angle_add_angle_add_angle_eq_pi s.P s.A_ne_B

Archive/Imo/Imo2006Q3.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ theorem subst_proof₁ (x y z s : ℝ) (hxyz : x + y + z = 0) :
7979
· rw [div_mul_eq_mul_div, le_div_iff₀' zero_lt_32]
8080
exact subst_wlog h' hxyz
8181
rcases (mul_nonneg_of_three x y z).resolve_left h' with h | h
82-
· convert this y z x _ h using 2 <;> linarith
83-
· convert this z x y _ h using 2 <;> linarith
82+
· convert! this y z x _ h using 2 <;> linarith
83+
· convert! this z x y _ h using 2 <;> linarith
8484

8585
theorem proof₁ {a b c : ℝ} :
8686
|a * b * (a ^ 2 - b ^ 2) + b * c * (b ^ 2 - c ^ 2) + c * a * (c ^ 2 - a ^ 2)| ≤

Archive/Imo/Imo2006Q5.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ theorem Polynomial.isPeriodicPt_eval_two {P : Polynomial ℤ} {t : ℤ}
7272
have Hdvd : C.Chain (· ∣ ·) := by
7373
rw [Cycle.chain_map, periodicOrbit_chain' _ ht]
7474
intro n
75-
convert sub_dvd_eval_sub ((fun x => P.eval x)^[n + 1] t) ((fun x => P.eval x)^[n] t) P <;>
75+
convert! sub_dvd_eval_sub ((fun x => P.eval x)^[n + 1] t) ((fun x => P.eval x)^[n] t) P <;>
7676
rw [Function.iterate_succ_apply']
7777
-- Any two entries in C have the same absolute value.
7878
have Habs :
@@ -112,7 +112,7 @@ theorem Polynomial.isPeriodicPt_eval_two {P : Polynomial ℤ} {t : ℤ}
112112
-- They must have opposite sign, so that P^{k + 1}(t) - P^k(t) = P^{k + 2}(t) - P^{k + 1}(t).
113113
rcases Int.natAbs_eq_natAbs_iff.1 (Habs n n.succ) with hn' | hn'
114114
· apply (hn _).elim
115-
convert hn' <;> simp only [Function.iterate_succ_apply']
115+
convert! hn' <;> simp only [Function.iterate_succ_apply']
116116
-- We deduce P^{k + 2}(t) = P^k(t) and hence P(P(t)) = t.
117117
· rw [neg_sub, sub_right_inj] at hn'
118118
simp only [Function.iterate_succ_apply'] at hn'

Archive/Imo/Imo2008Q2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ theorem imo2008_q2a (x y z : ℝ) (h : x * y * z = 1) (hx : x ≠ 1) (hy : y ≠
5151
have hmn_ne_zero : m + n ≠ 0 := by contrapose hz; field_simp; linarith
5252
have hc_sub_sub : c - (c - m - n) = m + n := by abel
5353
rw [ge_iff_le, ← sub_nonneg]
54-
convert sq_nonneg ((c * (m ^ 2 + n ^ 2 + m * n) - m * (m + n) ^ 2) / (m * n * (m + n)))
54+
convert! sq_nonneg ((c * (m ^ 2 + n ^ 2 + m * n) - m * (m + n) ^ 2) / (m * n * (m + n)))
5555
simp [field, hc_sub_sub]; ring
5656

5757
def rationalSolutions :=

Archive/Imo/Imo2010Q5.lean

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ lemma push {B : Fin 6 → ℕ} {i : Fin 6} (rB : Reachable B) (hi : i < 5) :
7979
Reachable (B - single i (B i) + single (i + 1) (2 * B i)) := by
8080
obtain hc | hc := (B i).eq_zero_or_pos
8181
· rwa [hc, mul_zero, single_zero, single_zero, add_zero, tsub_zero]
82-
· convert (rB.move1 hi hc).push hi using 1
82+
· convert! (rB.move1 hi hc).push hi using 1
8383
ext k; simp only [add_apply, sub_apply]
8484
rcases eq_or_ne k i with rfl | hk
8585
· simp_rw [single_eq_same, tsub_self, single_succ]
@@ -92,29 +92,29 @@ termination_by B i
9292
/-- `(0, 0, 5, 11, 0, 0)` is reachable. -/
9393
lemma five_eleven : Reachable (single 2 5 + single 3 11) := by
9494
have R : Reachable (single 1 3 + single 2 1 + single 3 1 + single 4 1 + single 5 1) := by
95-
convert base.push (show 0 < 5 by decide) using 1; decide
95+
convert! base.push (show 0 < 5 by decide) using 1; decide
9696
replace R : Reachable (single 2 7 + single 3 1 + single 4 1 + single 5 1) := by
97-
convert R.push (show 1 < 5 by decide) using 1; decide
97+
convert! R.push (show 1 < 5 by decide) using 1; decide
9898
replace R : Reachable (single 2 7 + single 4 3 + single 5 1) := by
99-
convert R.push (show 3 < 5 by decide) using 1; decide
99+
convert! R.push (show 3 < 5 by decide) using 1; decide
100100
replace R : Reachable (single 2 7 + single 5 7) := by
101-
convert R.push (show 4 < 5 by decide) using 1; decide
101+
convert! R.push (show 4 < 5 by decide) using 1; decide
102102
replace R : Reachable (single 2 6 + single 3 2 + single 5 7) := by
103-
convert R.move1 (show 2 < 5 by decide) (by decide) using 1; decide
103+
convert! R.move1 (show 2 < 5 by decide) (by decide) using 1; decide
104104
replace R : Reachable (single 2 6 + single 3 1 + single 4 2 + single 5 7) := by
105-
convert R.move1 (show 3 < 5 by decide) (by decide) using 1; decide
105+
convert! R.move1 (show 3 < 5 by decide) (by decide) using 1; decide
106106
replace R : Reachable (single 2 6 + single 3 1 + single 5 11) := by
107-
convert R.push (show 4 < 5 by decide) using 1; decide
107+
convert! R.push (show 4 < 5 by decide) using 1; decide
108108
replace R : Reachable (single 2 6 + single 4 11) := by
109-
convert R.move2 (show 3 < 4 by decide) (by decide) using 1; decide
110-
convert R.move2 (show 2 < 4 by decide) (by decide) using 1; decide
109+
convert! R.move2 (show 3 < 4 by decide) (by decide) using 1; decide
110+
convert! R.move2 (show 2 < 4 by decide) (by decide) using 1; decide
111111

112112
/-- Decrement $B_i$ and double $B_{i+1}$, assuming $B_{i+2} = 0$, by doing `push, move2`. -/
113113
lemma double {B : Fin 6 → ℕ} {i : Fin 6}
114114
(rB : Reachable B) (hi : i < 4) (pB : 0 < B i) (zB : B (i + 2) = 0) :
115115
Reachable (B + single (i + 1) (B (i + 1)) - single i 1) := by
116-
convert (rB.push (show i + 1 < 5 by grind)).move2 hi (by
117-
rw [add_apply, sub_apply, single_succ]; grind)
116+
convert!
117+
(rB.push (show i + 1 < 5 by grind)).move2 hi (by rw [add_apply, sub_apply, single_succ]; grind)
118118
ext k; simp only [comp_apply, add_apply, sub_apply]
119119
have (j : Fin 6) : j + 1 + 1 = j + 2 := by grind
120120
rcases eq_or_ne k i with rfl | hk
@@ -132,7 +132,7 @@ lemma doubles {B : Fin 6 → ℕ} {i : Fin 6} (rB : Reachable B) (hi : i < 4) (z
132132
Reachable (update (B - single i (B i)) (i + 1) (B (i + 1) * 2 ^ B i)) := by
133133
obtain hc | hc := (B i).eq_zero_or_pos
134134
· rwa [hc, single_zero, tsub_zero, pow_zero, mul_one, update_eq_self]
135-
· convert (rB.double hi hc zB).doubles hi (by
135+
· convert! (rB.double hi hc zB).doubles hi (by
136136
rw [sub_apply, add_apply, single_eq_of_ne (by simp), zB, zero_add, zero_tsub]) using 1
137137
ext k
138138
simp_rw [sub_apply, add_apply, single_eq_same, single_succ, single_succ', add_zero, tsub_zero,
@@ -149,9 +149,9 @@ termination_by B i
149149
lemma exp {B : Fin 6 → ℕ} {i : Fin 6}
150150
(rB : Reachable B) (hi : i < 4) (pB : 0 < B i) (zB : B (i + 1) = 0) (zB' : B (i + 2) = 0) :
151151
Reachable (B - single i (B i) + single (i + 1) (2 ^ B i)) := by
152-
convert (rB.move1 (show i < 5 by grind) pB).doubles hi (by
152+
convert! (rB.move1 (show i < 5 by grind) pB).doubles hi (by
153153
rw [add_apply, sub_apply, zB', single_eq_of_ne (by simp), tsub_zero,
154-
single_eq_of_ne (by simp), zero_add]) using 1
154+
single_eq_of_ne (by simp), zero_add]) using 1
155155
simp_rw [add_apply, sub_apply, single_eq_same, single_succ, single_succ', zB, zero_tsub, zero_add,
156156
add_zero, ← pow_succ', Nat.sub_add_cancel pB]
157157
ext k; simp only [add_apply, sub_apply]
@@ -167,7 +167,7 @@ lemma exp_mid {k n : ℕ} (h : Reachable (single 2 (k + 1) + single 3 n)) (hn :
167167
Reachable (single 2 k + single 3 (2 ^ n)) := by
168168
have md := h.exp (show 3 < 4 by decide) (by simp [hn])
169169
(by simp [add_apply, single_eq_of_ne]) (by simp [add_apply, single_eq_of_ne])
170-
convert md.move2 (show 2 < 4 by decide) (by
170+
convert! md.move2 (show 2 < 4 by decide) (by
171171
simp only [add_apply, sub_apply, single_eq_same]
172172
iterate 3 rw [single_eq_of_ne (by decide)]
173173
simp) using 1
@@ -192,7 +192,7 @@ lemma reduce {m n : ℕ} (h : Reachable (single 3 n)) (hmn : m ≤ n) : Reachabl
192192
| base => exact h
193193
| succ k _ ih =>
194194
apply ih
195-
convert h.move2 (show 3 < 4 by decide) k.succ_pos
195+
convert! h.move2 (show 3 < 4 by decide) k.succ_pos
196196
ext i; simp only [sub_apply, comp_apply]
197197
rcases eq_or_ne i 3 with rfl | i3
198198
· rw [swap_apply_of_ne_of_ne (by decide) (by decide)]
@@ -231,7 +231,7 @@ theorem result : Reachable (single 5 (2010 ^ 2010 ^ 2010)) := by
231231
-- See https://github.com/leanprover/lean4/issues/11713
232232
set m : ℕ := 2010
233233
have hm : m = 2010 := by rfl
234-
convert ((quarter_target hm).push (show 3 < 5 by decide)).push (show 4 < 5 by decide)
234+
convert! ((quarter_target hm).push (show 3 < 5 by decide)).push (show 4 < 5 by decide)
235235
simp only [single_eq_same, tsub_self, Fin.reduceAdd, zero_add, single_inj]
236236
rw [← mul_assoc, show 2 * 2 = 4 by rfl, mul_comm, Nat.div_mul_cancel]
237237
trans 2010 ^ 2

0 commit comments

Comments
 (0)