Skip to content

Commit afb33db

Browse files
committed
Fix Archive and Counterexamples.
1 parent b84d91b commit afb33db

18 files changed

Lines changed: 40 additions & 40 deletions

Archive/Imo/Imo1982Q3.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/Imo2006Q5.lean

Lines changed: 1 addition & 1 deletion
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 :

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/Imo2015Q6.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ lemma sum_telescope {m n : ℕ} (hm : N ≤ m) (hn : m < n) :
161161

162162
include ht in
163163
lemma le_sum_pool : ∑ i ∈ range b, (i : ℤ) ≤ ∑ x ∈ pool a t, x := by
164-
convert sum_range_le_sum fun x mx ↦ (mem_Icc.mp ((pool_subset_Icc ha) mx)).1
164+
convert! sum_range_le_sum fun x mx ↦ (mem_Icc.mp ((pool_subset_Icc ha) mx)).1
165165
· rw [hbN _ ht]
166166
· rw [zero_add]
167167

Archive/Imo/Imo2024Q1.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ lemma condition_sub_two_mul_int_iff {α : ℝ} (m : ℤ) : Condition (α - 2 * m
5252
simp_rw [← Finset.sum_sub_distrib, mul_sub]
5353
norm_cast
5454
simp_rw [Int.floor_sub_intCast, sub_sub_cancel_left]
55-
convert condition_two_mul_int (-m) n hn
55+
convert! condition_two_mul_int (-m) n hn
5656
norm_cast
5757
rw [Int.floor_intCast]
5858
simp
@@ -76,7 +76,7 @@ lemma mem_Ico_one_of_mem_Ioo (h : α ∈ Set.Ioo 0 2) : α ∈ Set.Ico 1 2 := by
7676
apply hr.ne'
7777
suffices ⌈α⁻¹⌉₊ = (1 : ℤ) from mod_cast this
7878
apply Int.eq_one_of_dvd_one (Int.zero_le_ofNat _)
79-
convert hc ⌈α⁻¹⌉₊ (zero_lt_one.trans hr)
79+
convert! hc ⌈α⁻¹⌉₊ (zero_lt_one.trans hr)
8080
rw [← Finset.add_sum_Ico_eq_sum_Icc hr.le]
8181
convert (add_zero _).symm
8282
· rw [Int.floor_eq_iff]
@@ -153,7 +153,7 @@ lemma not_condition_of_mem_Ioo {α : ℝ} (h : α ∈ Set.Ioo 0 2) : ¬Condition
153153
have hna := (hc.mem_Ico_n_of_mem_Ioo h hn).1
154154
rcases h with ⟨-, h2⟩
155155
have hna' : 2 - (n : ℝ)⁻¹ ≤ α := by
156-
convert hna using 1
156+
convert! hna using 1
157157
field
158158
rw [sub_eq_add_neg, ← le_sub_iff_add_le', neg_le, neg_sub] at hna'
159159
rw [le_inv_comm₀ (by linarith) (mod_cast hn), ← not_lt] at hna'

Archive/Imo/Imo2024Q2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ lemma dvd_pow_iff_of_dvd_sub {a b d n : ℕ} {z : ℤ} (ha : a.Coprime d)
3737
congr
3838
suffices (((ZMod.unitOfCoprime _ ha) ^ z : (ZMod d)ˣ) : ZMod d) =
3939
(((ZMod.unitOfCoprime _ ha) ^ (n : ℤ) : (ZMod d)ˣ) : ZMod d) by
40-
convert this
40+
convert! this
4141
rw [sub_eq_iff_eq_add] at hk
4242
rw [hk, zpow_add, zpow_mul]
4343
norm_cast

Archive/Imo/Imo2024Q3.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ lemma apply_add_one_eq_card {n : ℕ} (h : N ≤ n) :
113113
simp
114114

115115
@[simp] lemma nth_apply_eq_zero (n : ℕ) : Nat.nth (a · = 0) n = 0 := by
116-
convert Nat.nth_false _ with i
116+
convert! Nat.nth_false _ with i
117117
simp only [(hc.pos i).ne']
118118

119119
lemma nth_apply_add_one_eq {n : ℕ} (h : N ≤ n) : Nat.nth (a · = a n) (a (n + 1) - 1) = n := by
@@ -244,7 +244,7 @@ lemma card_lt_M_of_M_le {n : ℕ} (h : M a N ≤ n) :
244244
have ha : M a N ≤ a (Nat.nth (a · = n) (M a N - 1)) := (Nat.nth_mem _ hin').symm ▸ h
245245
refine ⟨ha, ?_⟩
246246
suffices H : a (Nat.nth (fun x ↦ a x = n) (M a N - 1) + 1) = M a N from Nat.le_of_eq H.symm
247-
convert hc.apply_nth_add_one_eq hin' (N_lt_of_M_le_apply ha).le using 1
247+
convert! hc.apply_nth_add_one_eq hin' (N_lt_of_M_le_apply ha).le using 1
248248

249249
lemma bddAbove_setOf_infinite_setOf_apply_eq : BddAbove {m | {i | a i = m}.Infinite} := by
250250
refine ⟨M a N, fun x hi ↦ ?_⟩
@@ -542,7 +542,7 @@ lemma apply_sub_one_big_of_apply_small_of_N'_lt {i : ℕ} (h : Small a (a i)) (h
542542

543543
lemma apply_sub_two_small_of_apply_small_of_N'_lt {i : ℕ} (h : Small a (a i)) (hN' : N' a N < i) :
544544
Small a (a (i - 2)) := by
545-
convert hc.apply_sub_one_small_of_apply_big_of_N'_le
545+
convert! hc.apply_sub_one_small_of_apply_big_of_N'_le
546546
(hc.apply_sub_one_big_of_apply_small_of_N'_lt h hN') (by lia) using 1
547547

548548
lemma N_add_one_lt_apply_of_apply_big_of_N'_le {i : ℕ} (h : Big a (a i)) (hN' : N' a N ≤ i) :
@@ -751,8 +751,8 @@ lemma exists_apply_sub_two_eq_of_apply_eq {i j : ℕ} (hi : N' a N + 2 < i) (hij
751751
congr 1
752752
ext t
753753
simp only [Finset.mem_filter, Finset.mem_range]
754-
refine ⟨fun ⟨htj, htj'⟩ ↦ ⟨?_, by convert htj' using 1⟩,
755-
fun ⟨htj, htj'⟩ ↦ ⟨by lia, by convert htj' using 1⟩⟩
754+
refine ⟨fun ⟨htj, htj'⟩ ↦ ⟨?_, by convert! htj' using 1⟩,
755+
fun ⟨htj, htj'⟩ ↦ ⟨by lia, by convert! htj' using 1⟩⟩
756756
by_contra htj''
757757
have ht1 : t = j - 1 := by lia
758758
subst ht1
@@ -923,7 +923,7 @@ lemma exists_p_eq : ∃ b c, ∀ n, b < n → p a (N' a N + 2 * n) = c := by
923923
· have hs : Small a (a (N' a N + 2 * (2 + t + u))) := by
924924
rw [hc.small_apply_N'_add_iff_even]
925925
simp
926-
convert hc.p_apply_le_p_apply_add_two (by lia) hs using 1
926+
convert! hc.p_apply_le_p_apply_add_two (by lia) hs using 1
927927
refine ⟨1 + t, c, fun n hn ↦ ?_⟩
928928
rw [show n = 2 + t + (n - (2 + t)) by lia]
929929
exact heqc _

Archive/Imo/Imo2024Q5.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ lemma Path.findFstEq_eq_find?_le (p : Path N) (r : Fin (N + 2)) : p.findFstEq r
249249

250250
lemma Path.firstMonster_isSome {p : Path N} {m : MonsterData N} :
251251
(p.firstMonster m).isSome = true ↔ ∃ x, x ∈ p.cells ∧ x ∈ m.monsterCells := by
252-
convert List.find?_isSome
252+
convert! List.find?_isSome
253253
simp
254254

255255
lemma Path.firstMonster_eq_none {p : Path N} {m : MonsterData N} :
256256
(p.firstMonster m) = none ↔ ∀ x, x ∈ p.cells → x ∉ m.monsterCells := by
257-
convert List.find?_eq_none
257+
convert! List.find?_eq_none
258258
simp
259259

260260
lemma Path.one_lt_length_cells (p : Path N) : 1 < p.cells.length := by
@@ -339,7 +339,7 @@ lemma Path.firstMonster_eq_of_findFstEq_mem {p : Path N} {m : MonsterData N}
339339
List.isChain_iff_getElem.1 p.valid_move_seq 0 (by lia)
340340
simp_rw [Adjacent, Nat.dist] at adj
341341
have hc0 : (p.cells[0].1 : ℕ) = 0 := by
342-
convert Fin.ext_iff.1 p.head_first_row
342+
convert! Fin.ext_iff.1 p.head_first_row
343343
exact List.getElem_zero _
344344
have hc1 : (p.cells[1].1 : ℕ) ≠ 0 := Fin.val_ne_iff.2 h0
345345
have h1 : (p.cells[1].1 : ℕ) = 1 := by lia
@@ -452,7 +452,7 @@ def Path.reflect (p : Path N) : Path N where
452452
lemma Path.firstMonster_reflect (p : Path N) (m : MonsterData N) :
453453
p.reflect.firstMonster m.reflect = (p.firstMonster m).map Cell.reflect := by
454454
simp_rw [firstMonster, reflect, List.find?_map]
455-
convert rfl
455+
convert! rfl
456456
simp only [Function.comp_apply, decide_eq_decide, MonsterData.monsterCells]
457457
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
458458
· rcases h with ⟨i, hi⟩
@@ -509,7 +509,7 @@ lemma Strategy.play_two (s : Strategy N) (m : MonsterData N) {k : ℕ} (hk : 2 <
509509
· have h : (1 : Fin 2) = Fin.last 1 := rfl
510510
simp only [Fin.snoc_zero, Nat.reduceAdd, Fin.mk_one, Fin.isValue, Matrix.cons_val]
511511
simp only [h, Fin.snoc_last]
512-
convert rfl
512+
convert! rfl
513513
simp_rw [Fin.fin_one_eq_zero, Matrix.cons_val]
514514

515515
lemma Strategy.WinsIn.mono (s : Strategy N) (m : MonsterData N) {k₁ k₂ : ℕ} (h : s.WinsIn m k₁)
@@ -555,7 +555,7 @@ lemma row1_mem_monsterCells_monsterData12 (hN : 2 ≤ N) (c₁ c₂ : Fin (N + 1
555555

556556
lemma row2_mem_monsterCells_monsterData12 (hN : 2 ≤ N) {c₁ c₂ : Fin (N + 1)} (h : c₁ ≠ c₂) :
557557
(⟨2, by lia⟩, c₂) ∈ (monsterData12 hN c₁ c₂).monsterCells := by
558-
convert Set.mem_range_self (row2 hN)
558+
convert! Set.mem_range_self (row2 hN)
559559
exact (monsterData12_apply_row2 hN h).symm
560560

561561
lemma Strategy.not_forcesWinIn_two (s : Strategy N) (hN : 2 ≤ N) : ¬ s.ForcesWinIn 2 := by

Archive/Kuratowski.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ theorem mem_theFourteen_iff_isObtainable {s t : Set X} :
102102
complement operations from a single set `s` is at most 14. -/
103103
theorem ncard_isObtainable_le_fourteen (s : Set X) : {t | IsObtainable s t}.ncard ≤ 14 := by
104104
classical
105-
convert Set.ncard_coe_finset _ ▸ (theFourteen s).toFinset_card_le
105+
convert! Set.ncard_coe_finset _ ▸ (theFourteen s).toFinset_card_le
106106
simp [Set.ext_iff, mem_theFourteen_iff_isObtainable]
107107

108108
end Topology.ClosureCompl

Archive/Sensitivity.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ theorem succ_n_eq (p q : Q n.succ) : p = q ↔ p 0 = q 0 ∧ π p = π q := by
9090
by_cases hx : x = 0
9191
· rwa [hx]
9292
· rw [← Fin.succ_pred x hx]
93-
convert congr_fun h (Fin.pred x hx)
93+
convert! congr_fun h (Fin.pred x hx)
9494

9595
/-- The adjacency relation defining the graph structure on `Q n`:
9696
`p.adjacent q` if there is an edge from `p` to `q` in `Q n`. -/
@@ -392,7 +392,7 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
392392
apply dim_V
393393
have dimW : dim W = card H := by
394394
have li : LinearIndependent ℝ (H.restrict e) := by
395-
convert (dualBases_e_ε m.succ).basis.linearIndependent.comp _ Subtype.val_injective
395+
convert! (dualBases_e_ε m.succ).basis.linearIndependent.comp _ Subtype.val_injective
396396
rw [(dualBases_e_ε _).coe_basis]
397397
rfl
398398
have hdW := rank_span li

0 commit comments

Comments
 (0)