imo.imo2011_q5
⟷
Archive.Imo.Imo2011Q5
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -62,7 +62,7 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
contradiction
have h₁ : f m = f (m - n) := sub_eq_zero.mp h_d_eq_zero
have h₂ : f (m - n) ∣ f m - f n := hdvd m n
- rw [← h₁] at h₂
+ rw [← h₁] at h₂
exact (dvd_iff_dvd_of_dvd_sub h₂).mp dvd_rfl
·-- m = n
rw [h_fm_eq_fn]
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,7 +3,7 @@ Copyright (c) 2021 Alain Verberkmoes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alain Verberkmoes
-/
-import Mathbin.Data.Int.Dvd.Basic
+import Data.Int.Dvd.Basic
#align_import imo.imo2011_q5 from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,14 +2,11 @@
Copyright (c) 2021 Alain Verberkmoes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alain Verberkmoes
-
-! This file was ported from Lean 3 source module imo.imo2011_q5
-! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Int.Dvd.Basic
+#align_import imo.imo2011_q5 from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
+
/-!
# IMO 2011 Q5
mathlib commit https://github.com/leanprover-community/mathlib/commit/bf2428c9486c407ca38b5b3fb10b87dad0bc99fa
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alain Verberkmoes
! This file was ported from Lean 3 source module imo.imo2011_q5
-! leanprover-community/mathlib commit 5f25c089cb34db4db112556f23c50d12da81b297
+! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -13,6 +13,9 @@ import Mathbin.Data.Int.Dvd.Basic
/-!
# IMO 2011 Q5
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
Let `f` be a function from the set of integers to the set
of positive integers. Suppose that, for any two integers
`m` and `n`, the difference `f(m) - f(n)` is divisible by
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -37,7 +37,6 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
calc
d < f m := sub_lt_self _ (hpos (m - n))
_ < f n := h_fm_lt_fn
-
have h_neg_d_lt_fn : -d < f n :=
by
calc
@@ -45,7 +44,6 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
_ < f (m - n) := (sub_lt_self _ (hpos m))
_ ≤ f n - f m := (le_of_dvd (sub_pos.mpr h_fm_lt_fn) _)
_ < f n := sub_lt_self _ (hpos m)
-
-- ⊢ f (m - n) ∣ f n - f m
rw [← dvd_neg, neg_sub];
exact hdvd m n
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3209ddf94136d36e5e5c624b10b2a347cc9d090
@@ -36,8 +36,8 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
have h_neg_d_lt_fn : -d < f n := by
calc
-d = f (m - n) - f m := neg_sub _ _
- _ < f (m - n) := (sub_lt_self _ (hpos m))
- _ ≤ f n - f m := (le_of_dvd (sub_pos.mpr h_fm_lt_fn) ?_)
+ _ < f (m - n) := sub_lt_self _ (hpos m)
+ _ ≤ f n - f m := le_of_dvd (sub_pos.mpr h_fm_lt_fn) ?_
_ < f n := sub_lt_self _ (hpos m)
-- ⊢ f (m - n) ∣ f n - f m
rw [← dvd_neg, neg_sub]
have
, replace
and suffices
(#10640)
No changes to tactic file, it's just boring fixes throughout the library.
This follows on from #6964.
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -30,12 +30,11 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
have h_fn_dvd_d : f n ∣ d := by
rw [← sub_sub_self m n]
exact hdvd m (m - n)
- have h_d_lt_fn : d < f n := by
+ have h_d_lt_fn : d < f n := calc
+ d < f m := sub_lt_self _ (hpos (m - n))
+ _ < f n := h_fm_lt_fn
+ have h_neg_d_lt_fn : -d < f n := by
calc
- d < f m := sub_lt_self _ (hpos (m - n))
- _ < f n := h_fm_lt_fn
- have h_neg_d_lt_fn : -d < f n
- · calc
-d = f (m - n) - f m := neg_sub _ _
_ < f (m - n) := (sub_lt_self _ (hpos m))
_ ≤ f n - f m := (le_of_dvd (sub_pos.mpr h_fm_lt_fn) ?_)
cases'
(#9171)
I literally went through and regex'd some uses of cases'
, replacing them with rcases
; this is meant to be a low effort PR as I hope that tools can do this in the future.
rcases
is an easier replacement than cases
, though with better tools we could in future do a second pass converting simple rcases
added here (and existing ones) to cases
.
@@ -24,7 +24,7 @@ open Int
theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m n : ℤ, f (m - n) ∣ f m - f n) :
∀ m n : ℤ, f m ≤ f n → f m ∣ f n := by
intro m n h_fm_le_fn
- cases' lt_or_eq_of_le h_fm_le_fn with h_fm_lt_fn h_fm_eq_fn
+ rcases lt_or_eq_of_le h_fm_le_fn with h_fm_lt_fn | h_fm_eq_fn
· -- m < n
let d := f m - f (m - n)
have h_fn_dvd_d : f n ∣ d := by
I know that this is contrary to what we've done previously, but:
norm_num
/ ring
/ linarith
)(Oh
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alain Verberkmoes
-/
import Mathlib.Data.Int.Dvd.Basic
+import Mathlib.Tactic.Common
#align_import imo.imo2011_q5 from "leanprover-community/mathlib"@"5f25c089cb34db4db112556f23c50d12da81b297"
@@ -2,14 +2,11 @@
Copyright (c) 2021 Alain Verberkmoes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alain Verberkmoes
-
-! This file was ported from Lean 3 source module imo.imo2011_q5
-! leanprover-community/mathlib commit 5f25c089cb34db4db112556f23c50d12da81b297
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Int.Dvd.Basic
+#align_import imo.imo2011_q5 from "leanprover-community/mathlib"@"5f25c089cb34db4db112556f23c50d12da81b297"
+
/-!
# IMO 2011 Q5
@@ -43,7 +43,7 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
_ ≤ f n - f m := (le_of_dvd (sub_pos.mpr h_fm_lt_fn) ?_)
_ < f n := sub_lt_self _ (hpos m)
-- ⊢ f (m - n) ∣ f n - f m
- rw [← dvd_neg, neg_sub];
+ rw [← dvd_neg, neg_sub]
exact hdvd m n
have h_d_eq_zero : d = 0 := by
obtain hd | hd | hd : d > 0 ∨ d = 0 ∨ d < 0 := trichotomous d 0
@@ -51,7 +51,7 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
have h₁ : f n ≤ d := le_of_dvd hd h_fn_dvd_d
have h₂ : ¬f n ≤ d := not_le.mpr h_d_lt_fn
contradiction
- ·-- d = 0
+ · -- d = 0
exact hd
· -- d < 0
have h₁ : f n ≤ -d := le_of_dvd (neg_pos.mpr hd) h_fn_dvd_d.neg_right
@@ -59,8 +59,8 @@ theorem imo2011_q5 (f : ℤ → ℤ) (hpos : ∀ n : ℤ, 0 < f n) (hdvd : ∀ m
contradiction
have h₁ : f m = f (m - n) := sub_eq_zero.mp h_d_eq_zero
have h₂ : f (m - n) ∣ f m - f n := hdvd m n
- rw [← h₁] at h₂
+ rw [← h₁] at h₂
exact (dvd_iff_dvd_of_dvd_sub h₂).mp dvd_rfl
- ·-- m = n
+ · -- m = n
rw [h_fm_eq_fn]
#align imo2011_q5 imo2011_q5
The unported dependencies are