-
Notifications
You must be signed in to change notification settings - Fork 1
/
Inclusion_de_la_imagen.lean
68 lines (61 loc) · 1.33 KB
/
Inclusion_de_la_imagen.lean
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
-- ---------------------------------------------------------------------
-- Ejercicio. Demostrar que
-- f '' s ⊆ t ↔ s ⊆ f ⁻¹' t
-- ----------------------------------------------------------------------
import data.set.function
universes u v
variable α : Type u
variable β : Type v
variable f : α → β
variables (s : set α) (t : set β)
open set
example : f '' s ⊆ t ↔ s ⊆ f ⁻¹' t :=
begin
split,
{ intros h x xs,
show f x ∈ t,
{ calc f x ∈ f '' s : mem_image_of_mem f xs
... ⊆ t : h }},
{ intros h y hy,
rcases hy with ⟨x,xs,fxy⟩,
rw ← fxy,
apply h,
exact xs },
end
-- Prueba
-- ======
/-
α : Type u,
β : Type v,
f : α → β,
s : set α,
t : set β
⊢ f '' s ⊆ t ↔ s ⊆ f ⁻¹' t
>> split,
| ⊢ f '' s ⊆ t → s ⊆ f ⁻¹' t
| >> { intros h x xs,
| h : f '' s ⊆ t,
| x : α,
| xs : x ∈ s
| ⊢ x ∈ f ⁻¹' t
| >> show f x ∈ t,
| >> { calc f x ∈ f '' s : mem_image_of_mem f xs
| >> ... ⊆ t : h }},
⊢ s ⊆ f ⁻¹' t → f '' s ⊆ t
>> { intros h y hy,
h : s ⊆ f ⁻¹' t,
y : β,
hy : y ∈ f '' s
⊢ y ∈ t
>> rcases hy with ⟨x,xs,fxy⟩,
x : α,
xs : x ∈ s,
fxy : f x = y
⊢ y ∈ t
>> rw ← fxy,
⊢ f x ∈ t
>> apply h,
⊢ x ∈ s
>> exact xs },
no goals
-/