-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
import Mathlib.Data.Real.Basic
def FnUb (f : ℝ → ℝ) (a : ℝ) : Prop :=
∀ x, f x ≤ a
def FnLb (f : ℝ → ℝ) (a : ℝ) : Prop :=
∀ x, a ≤ f x
def FnHasUb (f : ℝ → ℝ) :=
∃ a, FnUb f a
def FnHasLb (f : ℝ → ℝ) :=
∃ a, FnLb f a
theorem fnUb_add {f g : ℝ → ℝ} {a b : ℝ} (hfa : FnUb f a) (hgb : FnUb g b) :
FnUb (fun x => f x + g x) (a + b) :=
fun x => add_le_add (hfa x) (hgb x)
section
variable {f g : ℝ → ℝ}
example (lbf : FnHasLb f) (lbg : FnHasLb g) : FnHasLb fun x => f x + g x := by
cases' lbf with a lbfa
cases' lbg with b lbgb
use a + b
intro x
exact add_le_add (lbfa x) (lbgb x)
example {c : ℝ} (ubf : FnHasUb f) (h : c ≥ 0) : FnHasUb fun x => c * f x := by
cases' ubf with a lbfa
use c * a
intro x
exact mul_le_mul_of_nonneg_left (lbfa x) h
end
section
variable {a b c : ℕ}
example (divab : a ∣ b) (divbc : b ∣ c) : a ∣ c := by
rcases divab with ⟨d, rfl⟩
rcases divbc with ⟨e, rfl⟩
use d * e; ring
example (divab : a ∣ b) (divac : a ∣ c) : a ∣ b + c := by
rcases divab with ⟨d, rfl⟩
rcases divac with ⟨e, rfl⟩
use d + e; ring
end
section
open Function
example {c : ℝ} (h : c ≠ 0) : Surjective fun x => c * x := by
intro x
use x / c
dsimp; rw [mul_div_cancel' _ h]
example {c : ℝ} (h : c ≠ 0) : Surjective fun x => c * x := by
intro x
use x / c
field_simp [h] ; ring
end
section
open Function
variable {α : Type _} {β : Type _} {γ : Type _}
variable {g : β → γ} {f : α → β}
example (surjg : Surjective g) (surjf : Surjective f) : Surjective fun x => g (f x) := by
intro z
rcases surjg z with ⟨y, rfl⟩
rcases surjf y with ⟨x, rfl⟩
use x
end