-
Notifications
You must be signed in to change notification settings - Fork 1
/
StreamlessSets.v
38 lines (31 loc) · 1.17 KB
/
StreamlessSets.v
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
Definition streamless(X : Set) := forall f : nat -> X,
{i : nat & { j : nat | i <> j /\ f i = f j}}.
Theorem streamless_prod : forall X Y, streamless X -> streamless Y -> streamless (X * Y).
Proof.
intros X Y SX SY f.
Theorem streamless_sum : forall X Y, streamless X -> streamless Y -> streamless (X + Y).
Proof.
intros X Y SX SY f.
destruct (f 0) eqn:H.
- set (g := fun n => match f n with
| inl x0 => x0
| _ => x
end).
destruct (SX g) as [gi [gj [N Hg]]].
subst g. simpl in Hg.
destruct (f gi) eqn:Hi; destruct (f gj) eqn:Hj.
+ exists gi, gj. intuition congruence.
+ set (h := fun n => match f n with
| inl x0 => (x0, y)
| inr y0 => (x, y0)
end).
destruct (
-
Definition injective {A B} (g : A -> B) : Prop :=
(forall x y, g x = g y -> x = y).
Definition stream_splits {A B C} (f : A -> B) (k : C -> B) : Prop :=
exists (g : A -> A) (h : A -> C), injective g /\ (forall n, f (g n) = k (h n)).
Lemma sum_stream_split : forall X Y (f : nat -> X + Y),
stream_splits f inl \/
stream_splits f inr.
Admitted.