関数

Require Import power.

Definition id_function {A : Type}
  : A -> A :=
  fun a => a.

Definition compose_functions {A B C : Type}
  (g : B -> C)
  (f : A -> B)
  : A -> C :=
  fun a => g (f a).

Section Functions.
  Context {A B : Type}.
  Variable f : A -> B.

  Definition injective : Prop :=
    forall a a',
    f a = f a' ->
    a = a'.

  Definition surjective : Prop :=
    forall b,
    exists a,
    f a = b.

  Definition bijective : Prop :=
    injective /\ surjective.

  Definition isomorphic : Prop :=
    exists g : B -> A,
    compose_functions g f = id_function /\
    compose_functions f g = id_function.

  Definition preimage
    (S : power B)
    : power A :=
    fun a => f a ∈ S.

  Definition image
    (S : power A)
    : power B :=
    fun b => exists a, a ∈ S /\ f a = b.

  Definition pushforward
    (S : power A)
    : power B :=
    fun b => forall a : A, f a = b -> a ∈ S.

  Definition pushforward'
    (S : power A)
    : power B :=
    union (fun T => preimage T ⊆ S).
End Functions.

Definition isomorphism (A B : Type) : Type :=
  { f : A -> B | isomorphic f }.

Notation "A ≅ B" := (isomorphism A B) (at level 60, no associativity).

Section Functions.
  Context {A B C : Type}.
  Variable f : A -> B.
  Variable g : B -> C.

  
A, B, C: Type
f: A -> B
g: B -> C
S: power C

preimage (compose_functions g f) S = preimage f (preimage g S)
A, B, C: Type
f: A -> B
g: B -> C
S: power C

preimage (compose_functions g f) S = preimage f (preimage g S)
A, B, C: Type
f: A -> B
g: B -> C
S: power C

(fun a : A => g (f a) ∈ S) = (fun a : A => f a ∈ (fun a0 : B => g a0 ∈ S))
reflexivity. Qed. End Functions. Section Images. Context {A B : Type}. Variable f : A -> B.
A, B: Type
f: A -> B
S, T: power B

S ⊆ T -> preimage f S ⊆ preimage f T
A, B: Type
f: A -> B
S, T: power B

S ⊆ T -> preimage f S ⊆ preimage f T
A, B: Type
f: A -> B
S, T: power B
H: S ⊆ T
x: A
H0: x ∈ preimage f S

x ∈ preimage f T
A, B: Type
f: A -> B
S, T: power B
H: S ⊆ T
x: A
H0: S (f x)

T (f x)
A, B: Type
f: A -> B
S, T: power B
H: S ⊆ T
x: A
H0: S (f x)

f x ∈ S
assumption. Qed.
A, B: Type
f: A -> B
S, T: power A

S ⊆ T -> image f S ⊆ image f T
A, B: Type
f: A -> B
S, T: power A

S ⊆ T -> image f S ⊆ image f T
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
H0: x ∈ image f S

x ∈ image f T
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
H0: exists a : A, S a /\ f a = x

exists a : A, T a /\ f a = x
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
y: A
H1: S y
H2: f y = x

exists a : A, T a /\ f a = x
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
y: A
H1: S y
H2: f y = x

T y /\ f y = x
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
y: A
H1: S y
H2: f y = x

T y
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
y: A
H1: S y
H2: f y = x
f y = x
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
y: A
H1: S y
H2: f y = x

T y
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
y: A
H1: S y
H2: f y = x

y ∈ S
exact H1.
A, B: Type
f: A -> B
S, T: power A
H: S ⊆ T
x: B
y: A
H1: S y
H2: f y = x

f y = x
assumption. Qed.
A, B: Type
f: A -> B
S: power B

image f (preimage f S) ⊆ S
A, B: Type
f: A -> B
S: power B

image f (preimage f S) ⊆ S
A, B: Type
f: A -> B
S: power B
x: B
H: x ∈ image f (preimage f S)

x ∈ S
A, B: Type
f: A -> B
S: power B
x: B
H: exists a : A, S (f a) /\ f a = x

x ∈ S
A, B: Type
f: A -> B
S: power B
x: B
y: A
H1: S (f y)
H2: f y = x

x ∈ S
A, B: Type
f: A -> B
S: power B
y: A
H1: S (f y)

f y ∈ S
exact H1. Qed.
A, B: Type
f: A -> B
S: power A

S ⊆ preimage f (image f S)
A, B: Type
f: A -> B
S: power A

S ⊆ preimage f (image f S)
A, B: Type
f: A -> B
S: power A
x: A
H: x ∈ S

x ∈ preimage f (image f S)
A, B: Type
f: A -> B
S: power A
x: A
H: x ∈ S

exists a : A, S a /\ f a = f x
A, B: Type
f: A -> B
S: power A
x: A
H: x ∈ S

S x /\ f x = f x
split; [exact H | reflexivity]. Qed.
A, B: Type
f: A -> B
S: power A
T: power B

image f S ⊆ T <-> S ⊆ preimage f T
A, B: Type
f: A -> B
S: power A
T: power B

image f S ⊆ T <-> S ⊆ preimage f T
A, B: Type
f: A -> B
S: power A
T: power B
H: image f S ⊆ T

S ⊆ preimage f T
A, B: Type
f: A -> B
S: power A
T: power B
H: S ⊆ preimage f T
image f S ⊆ T
A, B: Type
f: A -> B
S: power A
T: power B
H: image f S ⊆ T

S ⊆ preimage f T
A, B: Type
f: A -> B
S: power A
T: power B
H: image f S ⊆ T

S ⊆ ?T
A, B: Type
f: A -> B
S: power A
T: power B
H: image f S ⊆ T
?T ⊆ preimage f T
A, B: Type
f: A -> B
S: power A
T: power B
H: image f S ⊆ T

S ⊆ ?T
apply preimage_of_image.
A, B: Type
f: A -> B
S: power A
T: power B
H: image f S ⊆ T

preimage f (image f S) ⊆ preimage f T
A, B: Type
f: A -> B
S: power A
T: power B
H: image f S ⊆ T

image f S ⊆ T
exact H.
A, B: Type
f: A -> B
S: power A
T: power B
H: S ⊆ preimage f T

image f S ⊆ T
A, B: Type
f: A -> B
S: power A
T: power B
H: S ⊆ preimage f T

image f S ⊆ ?T
A, B: Type
f: A -> B
S: power A
T: power B
H: S ⊆ preimage f T
?T ⊆ T
A, B: Type
f: A -> B
S: power A
T: power B
H: S ⊆ preimage f T

image f S ⊆ ?T
A, B: Type
f: A -> B
S: power A
T: power B
H: S ⊆ preimage f T

S ⊆ ?T
exact H.
A, B: Type
f: A -> B
S: power A
T: power B
H: S ⊆ preimage f T

image f (preimage f T) ⊆ T
apply image_of_preimage. Qed.
A, B: Type
f: A -> B
S: power B

surjective f -> image f (preimage f S) = S
A, B: Type
f: A -> B
S: power B

surjective f -> image f (preimage f S) = S
A, B: Type
f: A -> B
S: power B
H: surjective f

image f (preimage f S) = S
A, B: Type
f: A -> B
S: power B
H: surjective f

image f (preimage f S) ⊆ S
A, B: Type
f: A -> B
S: power B
H: surjective f
S ⊆ image f (preimage f S)
A, B: Type
f: A -> B
S: power B
H: surjective f

image f (preimage f S) ⊆ S
apply image_of_preimage.
A, B: Type
f: A -> B
S: power B
H: surjective f

S ⊆ image f (preimage f S)
A, B: Type
f: A -> B
S: power B
H: surjective f
x: B
H0: x ∈ S

x ∈ image f (preimage f S)
A, B: Type
f: A -> B
S: power B
x: B
H: exists a : A, f a = x
H0: x ∈ S

x ∈ image f (preimage f S)
A, B: Type
f: A -> B
S: power B
x: B
y: A
H1: f y = x
H0: x ∈ S

x ∈ image f (preimage f S)
A, B: Type
f: A -> B
S: power B
x: B
y: A
H1: f y = x
H0: x ∈ S

y ∈ preimage f S /\ f y = x
A, B: Type
f: A -> B
S: power B
y: A
H0: f y ∈ S

y ∈ preimage f S /\ f y = f y
A, B: Type
f: A -> B
S: power B
y: A
H0: f y ∈ S

S (f y) /\ f y = f y
split; [exact H0 | reflexivity]. Qed.
A, B: Type
f: A -> B
S: power A

injective f -> preimage f (image f S) = S
A, B: Type
f: A -> B
S: power A

injective f -> preimage f (image f S) = S
A, B: Type
f: A -> B
S: power A
H: injective f

preimage f (image f S) = S
A, B: Type
f: A -> B
S: power A
H: injective f

preimage f (image f S) ⊆ S
A, B: Type
f: A -> B
S: power A
H: injective f
S ⊆ preimage f (image f S)
A, B: Type
f: A -> B
S: power A
H: injective f

preimage f (image f S) ⊆ S
A, B: Type
f: A -> B
S: power A
H: injective f
x: A
H0: x ∈ preimage f (image f S)

x ∈ S
A, B: Type
f: A -> B
S: power A
H: injective f
x: A
H0: f x ∈ image f S

x ∈ S
A, B: Type
f: A -> B
S: power A
H: injective f
x, y: A
H0: y ∈ S
H1: f y = f x

x ∈ S
A, B: Type
f: A -> B
S: power A
H: injective f
x, y: A
H0: y ∈ S
H1: y = x

x ∈ S
A, B: Type
f: A -> B
S: power A
H: injective f
x: A
H0: x ∈ S

x ∈ S
assumption.
A, B: Type
f: A -> B
S: power A
H: injective f

S ⊆ preimage f (image f S)
apply preimage_of_image. Qed.
A, B: Type
f: A -> B
S: power A

pushforward f S = pushforward' f S
A, B: Type
f: A -> B
S: power A

pushforward f S = pushforward' f S
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

b ∈ pushforward' f S
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward' f S
b ∈ pushforward f S
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

b ∈ pushforward' f S
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

b ∈ ⋃ (fun T : power B => preimage f T ⊆ S)
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

singleton b ∈ (fun T : power B => preimage f T ⊆ S) /\ b ∈ singleton b
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

singleton b ∈ (fun T : power B => preimage f T ⊆ S)
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S
b ∈ singleton b
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

singleton b ∈ (fun T : power B => preimage f T ⊆ S)
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

preimage f (singleton b) ⊆ S
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S
a: A
H0: a ∈ preimage f (singleton b)

a ∈ S
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S
a: A
H0: f a = b

a ∈ S
A, B: Type
f: A -> B
S: power A
b: B
H: forall a : A, f a = b -> S a
a: A
H0: f a = b

a ∈ S
A, B: Type
f: A -> B
S: power A
b: B
H: forall a : A, f a = b -> S a
a: A
H0: f a = b

f a = b
assumption.
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

b ∈ singleton b
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward f S

b = b
reflexivity.
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward' f S

b ∈ pushforward f S
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward' f S

forall a : A, f a = b -> S a
A, B: Type
f: A -> B
S: power A
b: B
H: b ∈ pushforward' f S
a: A
H0: f a = b

S a
A, B: Type
f: A -> B
S: power A
b: B
T: power B
H1: T ∈ (fun T : power B => preimage f T ⊆ S)
H2: b ∈ T
a: A
H0: f a = b

S a
A, B: Type
f: A -> B
S: power A
b: B
T: power B
H1: preimage f T ⊆ S
H2: b ∈ T
a: A
H0: f a = b

S a
A, B: Type
f: A -> B
S: power A
T: power B
H1: preimage f T ⊆ S
a: A
H2: f a ∈ T

S a
A, B: Type
f: A -> B
S: power A
T: power B
H1: preimage f T ⊆ S
a: A
H2: f a ∈ T

a ∈ preimage f T
apply H2. Qed. End Images.

TODO: pushforward は preimage の右随伴となるはずであり、これは随伴関手定理の具体例となるはずである。