fix(algebra/ordered_field, analysis/real_limit): generalize theorem to ordered fields

This commit is contained in:
Rob Lewis 2016-02-01 15:51:29 -05:00 committed by Leonardo de Moura
parent f402f322aa
commit a675a5ede2
2 changed files with 19 additions and 19 deletions

View file

@ -549,4 +549,22 @@ section discrete_linear_ordered_field
... = ((a * 2) / 2) / 2 : by rewrite -div_div_eq_div_mul ... = ((a * 2) / 2) / 2 : by rewrite -div_div_eq_div_mul
... = a / 2 : by rewrite (mul_div_cancel a two_ne_zero) ... = a / 2 : by rewrite (mul_div_cancel a two_ne_zero)
lemma div_two_add_div_four_lt {a : A} (H : a > 0) : a / 2 + a / 4 < a :=
begin
replace (4 : A) with (2 : A) + 2,
have Hne : (2 + 2 : A) ≠ 0, from ne_of_gt four_pos,
krewrite (div_add_div _ _ two_ne_zero Hne),
have Hnum : (2 + 2 + 2) / (2 * (2 + 2)) = (3 : A) / 4, by norm_num,
rewrite [{2 * a}mul.comm, -left_distrib, mul_div_assoc, -mul_one a at {2}], krewrite Hnum,
apply mul_lt_mul_of_pos_left,
apply div_lt_of_mul_lt_of_pos,
apply four_pos,
rewrite one_mul,
replace (3 : A) with (2 : A) + 1,
replace (4 : A) with (2 : A) + 2,
apply add_lt_add_left,
apply two_gt_one,
exact H
end
end discrete_linear_ordered_field end discrete_linear_ordered_field

View file

@ -263,24 +263,6 @@ proposition mul_right_converges_to_seq (c : ) (HX : X ⟶ x in ) :
have (λ n, X n * c) = (λ n, c * X n), from funext (take x, !mul.comm), have (λ n, X n * c) = (λ n, c * X n), from funext (take x, !mul.comm),
by+ rewrite [this, mul.comm]; apply mul_left_converges_to_seq c HX by+ rewrite [this, mul.comm]; apply mul_left_converges_to_seq c HX
protected lemma add_half_quarter {a : } (H : a > 0) : a / 2 + a / 4 < a :=
begin
replace (4 : ) with (2 : ) + 2,
have Hne : (2 + 2 : ) ≠ 0, from ne_of_gt four_pos,
krewrite (div_add_div _ _ two_ne_zero Hne),
have Hnum : (2 + 2 + 2) / (2 * (2 + 2)) = (3 : ) / 4, by norm_num,
rewrite [{2 * a}mul.comm, -left_distrib, mul_div_assoc, -mul_one a at {2}], krewrite Hnum,
apply mul_lt_mul_of_pos_left,
apply div_lt_of_mul_lt_of_pos,
apply four_pos,
rewrite one_mul,
replace (3 : ) with (2 : ) + 1,
replace (4 : ) with (2 : ) + 2,
apply add_lt_add_left,
apply two_gt_one,
exact H
end
theorem converges_to_seq_squeeze (HX : X ⟶ x in ) (HY : Y ⟶ x in ) {Z : } (HZX : ∀ n, X n ≤ Z n) theorem converges_to_seq_squeeze (HX : X ⟶ x in ) (HY : Y ⟶ x in ) {Z : } (HZX : ∀ n, X n ≤ Z n)
(HZY : ∀ n, Z n ≤ Y n) : Z ⟶ x in := (HZY : ∀ n, Z n ≤ Y n) : Z ⟶ x in :=
begin begin
@ -320,7 +302,7 @@ theorem converges_to_seq_squeeze (HX : X ⟶ x in ) (HY : Y ⟶ x in ) {Z
apply HZX, apply HZX,
apply HN1, apply HN1,
apply ge.trans Hn !le_max_left, apply ge.trans Hn !le_max_left,
apply add_half_quarter apply div_two_add_div_four_lt
end, end,
exact H exact H
end end