2015-05-06 17:01:24 +00:00
|
|
|
import data.set
|
|
|
|
open set function eq.ops
|
|
|
|
|
|
|
|
variables {X Y Z : Type}
|
|
|
|
|
|
|
|
lemma image_compose (f : Y → X) (g : X → Y) (a : set X) : (f ∘ g) '[a] = f '[g '[a]] :=
|
|
|
|
setext (take z,
|
|
|
|
iff.intro
|
|
|
|
(assume Hz : z ∈ (f ∘ g) '[a],
|
|
|
|
obtain x (Hx₁ : x ∈ a) (Hx₂ : f (g x) = z), from Hz,
|
2015-06-11 00:00:47 +00:00
|
|
|
have Hgx : g x ∈ g '[a], from mem_image Hx₁ rfl,
|
|
|
|
show z ∈ f '[g '[a]], from mem_image Hgx Hx₂)
|
2015-05-06 17:01:24 +00:00
|
|
|
(assume Hz : z ∈ f '[g '[a]],
|
|
|
|
obtain y [x (Hz₁ : x ∈ a) (Hz₂ : g x = y)] (Hy₂ : f y = z), from Hz,
|
2015-06-11 00:00:47 +00:00
|
|
|
show z ∈ (f ∘ g) '[a], from mem_image Hz₁ (Hz₂⁻¹ ▸ Hy₂)))
|