@@ -11,14 +11,14 @@ import data.real.basic
11
11
/-!
12
12
# IMO 2013 Q5
13
13
14
- Let ℚ>₀ be the set of positive rational numbers. Let f : ℚ>₀ → ℝ be a function satisfying
14
+ Let ` ℚ>₀` be the positive rational numbers. Let `f : ℚ>₀ → ℝ` be a function satisfying
15
15
the conditions
16
16
17
- (1) f(x) * f(y) ≥ f(x * y)
18
- (2) f(x + y) ≥ f(x) + f(y)
17
+ 1. ` f(x) * f(y) ≥ f(x * y)`
18
+ 2. ` f(x + y) ≥ f(x) + f(y)`
19
19
20
- for all x, y ∈ ℚ>₀. Given that f(a) = a for some rational a > 1, prove that f(x) = x for
21
- all x ∈ ℚ>₀.
20
+ for all `x, y ∈ ℚ>₀` . Given that ` f(a) = a` for some rational ` a > 1` , prove that ` f(x) = x` for
21
+ all ` x ∈ ℚ>₀` .
22
22
23
23
# Solution
24
24
@@ -98,54 +98,39 @@ lemma f_pos_of_pos {f : ℚ → ℝ} {q : ℚ} (hq : 0 < q)
98
98
(H4 : ∀ n : ℕ, 0 < n → (n : ℝ) ≤ f n) :
99
99
0 < f q :=
100
100
begin
101
- have hfqn := calc f q.num = f (q * q.denom) : by rw ←rat.mul_denom_eq_num
102
- ... ≤ f q * f q.denom : H1 q q.denom hq (nat.cast_pos.mpr q.pos),
103
-
104
- -- Now we just need to show that `f q.num` and `f q.denom` are positive.
105
- -- Then nlinarith will be able to close the goal.
106
-
107
101
have num_pos : 0 < q.num := rat.num_pos_iff_pos.mpr hq,
108
- have hqna : (q.num.nat_abs : ℤ) = q.num := int.nat_abs_of_nonneg num_pos.le,
109
- have hqfn' :=
110
- calc (q.num : ℝ)
111
- = ((q.num.nat_abs : ℤ) : ℝ) : congr_arg coe (eq.symm hqna)
112
- ... ≤ f q.num.nat_abs : H4 q.num.nat_abs
113
- (int.nat_abs_pos_of_ne_zero (ne_of_gt num_pos))
114
- ... = f q.num : by exact_mod_cast congr_arg f (congr_arg coe hqna),
115
-
116
- have f_num_pos := calc (0 : ℝ) < q.num : int.cast_pos.mpr num_pos
117
- ... ≤ f q.num : hqfn',
118
- have f_denom_pos := calc (0 : ℝ) < q.denom : nat.cast_pos.mpr q.pos
119
- ... ≤ f q.denom : H4 q.denom q.pos,
120
- nlinarith
102
+ have hmul_pos :=
103
+ calc (0 : ℝ) < q.num : int.cast_pos.mpr num_pos
104
+ ... = ((q.num.nat_abs : ℤ) : ℝ) : congr_arg coe (int.nat_abs_of_nonneg num_pos.le).symm
105
+ ... ≤ f q.num.nat_abs : H4 q.num.nat_abs
106
+ (int.nat_abs_pos_of_ne_zero num_pos.ne')
107
+ ... = f q.num : by { rw ←int.nat_abs_of_nonneg num_pos.le, norm_cast }
108
+ ... = f (q * q.denom) : by rw ←rat.mul_denom_eq_num
109
+ ... ≤ f q * f q.denom : H1 q q.denom hq (nat.cast_pos.mpr q.pos),
110
+ have h_f_denom_pos :=
111
+ calc (0 : ℝ) < q.denom : nat.cast_pos.mpr q.pos
112
+ ... ≤ f q.denom : H4 q.denom q.pos,
113
+ exact pos_of_mul_pos_right hmul_pos h_f_denom_pos.le,
121
114
end
122
115
123
116
lemma fx_gt_xm1 {f : ℚ → ℝ} {x : ℚ} (hx : 1 ≤ x)
124
117
(H1 : ∀ x y, 0 < x → 0 < y → f (x * y) ≤ f x * f y)
125
118
(H2 : ∀ x y, 0 < x → 0 < y → f x + f y ≤ f (x + y))
126
119
(H4 : ∀ n : ℕ, 0 < n → (n : ℝ) ≤ f n) :
127
- (( x - 1 : ℚ) : ℝ) < f x :=
120
+ (x - 1 : ℝ) < f x :=
128
121
begin
129
- have hfe : (⌊x⌋.nat_abs : ℤ) = ⌊x⌋ := int.nat_abs_of_nonneg
130
- (floor_nonneg.mpr (zero_le_one.trans hx)),
131
- have hfe' : (⌊x⌋.nat_abs : ℚ) = ⌊x⌋, { exact_mod_cast hfe },
132
- have h0fx : 0 < ⌊x⌋ := int.cast_pos.mp ((sub_nonneg.mpr hx).trans_lt (sub_one_lt_floor x)),
133
- have h_nat_abs_floor_pos : 0 < ⌊x⌋.nat_abs := int.nat_abs_pos_of_ne_zero (ne_of_gt h0fx),
134
- have hx0 := calc ((x - 1 : ℚ) : ℝ)
135
- < ⌊x⌋ : by exact_mod_cast sub_one_lt_floor x
136
- ... = ↑⌊x⌋.nat_abs : by exact_mod_cast hfe.symm
137
- ... ≤ f ⌊x⌋.nat_abs : H4 ⌊x⌋.nat_abs h_nat_abs_floor_pos
138
- ... = f ⌊x⌋ : by rw hfe',
139
-
140
- obtain (h_eq : (⌊x⌋ : ℚ) = x) | (h_lt : (⌊x⌋ : ℚ) < x) := (floor_le x).eq_or_lt,
122
+ have hx0 :=
123
+ calc (x - 1 : ℝ)
124
+ < ⌊x⌋₊ : by exact_mod_cast sub_one_lt_nat_floor x
125
+ ... ≤ f ⌊x⌋₊ : H4 _ (nat_floor_pos.2 hx),
126
+
127
+ obtain h_eq | h_lt := (nat_floor_le $ zero_le_one.trans hx).eq_or_lt,
141
128
{ rwa h_eq at hx0 },
142
129
143
- calc ((x - 1 : ℚ) : ℝ) < f ⌊x⌋ : hx0
144
- ... < f (x - ⌊x⌋) + f ⌊x⌋ : lt_add_of_pos_left (f ↑⌊x⌋)
145
- (f_pos_of_pos (sub_pos.mpr h_lt) H1 H4)
146
- ... ≤ f (x - ⌊x⌋ + ⌊x⌋) : H2 (x - ⌊x⌋) ⌊x⌋ (sub_pos.mpr h_lt)
147
- (by exact_mod_cast h0fx)
148
- ... = f x : by simp only [sub_add_cancel]
130
+ calc (x - 1 : ℝ) < f ⌊x⌋₊ : hx0
131
+ ... < f (x - ⌊x⌋₊) + f ⌊x⌋₊ : lt_add_of_pos_left _ (f_pos_of_pos (sub_pos.mpr h_lt) H1 H4)
132
+ ... ≤ f (x - ⌊x⌋₊ + ⌊x⌋₊) : H2 _ _ (sub_pos.mpr h_lt) (nat.cast_pos.2 (nat_floor_pos.2 hx))
133
+ ... = f x : by rw sub_add_cancel
149
134
end
150
135
151
136
lemma pow_f_le_f_pow {f : ℚ → ℝ} {n : ℕ} (hn : 0 < n) {x : ℚ} (hx : 1 < x)
@@ -223,7 +208,7 @@ begin
223
208
have H3 : ∀ x : ℚ, 0 < x → ∀ n : ℕ, 0 < n → ↑n * f x ≤ f (n * x),
224
209
{ intros x hx n hn,
225
210
cases n,
226
- { exfalso, exact nat.lt_asymm hn hn },
211
+ { exact (lt_irrefl 0 hn).elim },
227
212
induction n with pn hpn,
228
213
{ simp only [one_mul, nat.cast_one] },
229
214
calc (↑pn + 1 + 1 ) * f x
@@ -247,7 +232,7 @@ begin
247
232
... = ↑a * f 1 : by rw hae },
248
233
249
234
calc (n : ℝ) = (n : ℝ) * 1 : (mul_one _).symm
250
- ... ≤ (n : ℝ) * f 1 : (mul_le_mul_left (nat.cast_pos.mpr hn)).mpr hf1
235
+ ... ≤ (n : ℝ) * f 1 : mul_le_mul_of_nonneg_left hf1 (nat.cast_nonneg _)
251
236
... ≤ f (n * 1 ) : H3 1 zero_lt_one n hn
252
237
... = f n : by rw mul_one },
253
238
0 commit comments