Exercise session 5 — Advanced elimination / induction — Solutions
- Files:
Set Default Goal Selector "!". Set Default Goal Selector "!". From Stdlib Require Import Arith Lia List. Import ListNotations.
Exercise: Booleans in Prop
Define a copy of Booleans called boolp that lives in Prop.
Show that you can go from bool to boolp.
Can you do the converse? Why?
What would a surjective function from boolp to bool mean for
proof irrelevance? (We want to see a proof.)
Inductive boolp : Prop := ptrue' | pfalse'. Definition to_boolp (b : bool) : boolp := if b then ptrue' else pfalse'.
Answer.
We can't go the other way because boolp doesn't satisfy the subsingleton
criterion: it has two constructors.
If we assume such a function, then we can negate proof irrelevance.
forall f : boolp -> bool, (forall b : bool, b = f (to_boolp b)) -> ~ (forall (P : Prop) (u v : P), u = v)forall f : boolp -> bool, (forall b : bool, b = f (to_boolp b)) -> ~ (forall (P : Prop) (u v : P), u = v)f: boolp -> bool
hf: forall b : bool, b = f (to_boolp b)
PI: forall (P : Prop) (u v : P), u = vFalsef: boolp -> bool
hf: forall b : bool, b = f (to_boolp b)
PI: ptrue' = pfalse'Falsef: boolp -> bool
hf: forall b : bool, b = f (to_boolp b)
PI: ptrue' = pfalse'
e1: true = f (to_boolp true)Falsef: boolp -> bool
hf: forall b : bool, b = f (to_boolp b)
PI: ptrue' = pfalse'
e1: true = f (to_boolp true)
e2: false = f (to_boolp false)Falsef: boolp -> bool
hf: forall b : bool, b = f (to_boolp b)
PI: ptrue' = pfalse'
e1: true = f ptrue'
e2: false = f pfalse'Falsef: boolp -> bool
hf: forall b : bool, b = f (to_boolp b)
PI: ptrue' = pfalse'
e1: true = f pfalse'
e2: false = f pfalse'Falsediscriminate. Qed.f: boolp -> bool
hf: forall b : bool, b = f (to_boolp b)
PI: ptrue' = pfalse'
e1: true = false
e2: false = f pfalse'False
Exercise: Surjectivity
Prove that for all p : boolp, there exists some b : bool such that
its mapping to boolp is equal to p.
forall p : boolp, exists b : bool, to_boolp b = pforall p : boolp, exists b : bool, to_boolp b = pexists b : bool, to_boolp b = ptrue'exists b : bool, to_boolp b = pfalse'exists b : bool, to_boolp b = ptrue'reflexivity.to_boolp true = ptrue'unshelve eexists ; econstructor. Qed.exists b : bool, to_boolp b = pfalse'
Exercise: Existential quantifier and Σ types
exists (x : A), P x and { x : A | P x } are two very similar types but
the former lives in Prop while the latter is in Type.
Show how one implies the other.
Why is the other implication not provable?
A: Type
P: A -> Prop{x : A | P x} -> exists x : A, P xA: Type
P: A -> Prop{x : A | P x} -> exists x : A, P xA: Type
P: A -> Prop
x: A
h: P xexists x0 : A, P x0assumption. Qed.A: Type
P: A -> Prop
x: A
h: P xP x
Answer.
The other implication once again would eliminate a proof (whose type is in
Prop) to produce a value, and that is not allowed.
Exercise: Disjunction and sum
P \/ Q and A + B are also similar types. The first you know as
disjunction of propositions, the other one is relevant data that contains either
a value of type A, or a value of type B.
Prove that P + Q -> P \/ Q, ideally with a proof term.
Why is the other implication not provable?
Definition to_disj {P Q : Prop} (x : P + Q) : P \/ Q := match x with | inl p => or_introl p | inr q => or_intror q end.
Answer.
Same answer as usual, one cannot examine a proof to produce so-called relevant
data (in Type).
Exercise: Existential quantifier on Booleans
We can't show that (exists x, P x) -> { x : A | P x } in general, but we can
when A is bool and when P x is of the form f x = true. Show it.
forall f : bool -> bool, (exists b : bool, f b = true) -> {b : bool | f b = true}forall f : bool -> bool, (exists b : bool, f b = true) -> {b : bool | f b = true}f: bool -> bool
h: exists b : bool, f b = true{b : bool | f b = true}f: bool -> bool
h: exists b : bool, f b = true
etrue: f true = true{b : bool | f b = true}f: bool -> bool
h: exists b : bool, f b = true
etrue: f true = false{b : bool | f b = true}f: bool -> bool
h: exists b : bool, f b = true
etrue: f true = true{b : bool | f b = true}assumption.f: bool -> bool
h: exists b : bool, f b = true
etrue: f true = truef true = truef: bool -> bool
h: exists b : bool, f b = true
etrue: f true = false{b : bool | f b = true}f: bool -> bool
h: exists b : bool, f b = true
etrue: f true = falsef false = truef: bool -> bool
b: bool
e: f b = true
etrue: f true = falsef false = truef: bool -> bool
e: f true = true
etrue: f true = falsef false = truef: bool -> bool
e: f false = true
etrue: f true = falsef false = truef: bool -> bool
e: f true = true
etrue: f true = falsef false = truediscriminate.f: bool -> bool
e: f true = true
etrue: true = falsef false = trueassumption. Qed.f: bool -> bool
e: f false = true
etrue: f true = falsef false = true
Exercise: True is a singleton
Show that, for any P : True -> Type, it is enough to prove P I to prove any
P p. Try to do it with a proof term and explain why it is allowed.
Definition true_rect (P : True -> Type) (h : P I) (t : True) : P t :=
match t with I => h end.Answer.
This elimination is allowed because True satisfies the subsingleton criterion:
It has exactly one constructor
I(so in particular at most one).Ihas no arguments, so in particular all its non-parameter arguments are proofs.
Exercise: Ex falso
Write a term that goes from False to any A : Type.
Explain why this term is allowed.
Definition exfalso'' {A : Type} (bot : False) : A :=
match bot with end.Answer.
This elimination is allowed because False satisfies the subsingleton
criterion:
It has no constructors (so in particular at most one).
So, vacuously, all non-parameter arguments of constructors are proofs.
Exercise: Conjunction
We have seen above that disjunction did not satisfy the subsingleton criterion.
What about conjunction?
State the equivalence between P * Q and P /\ Q.
Either give a proof script that fails because conjunction does not satisfy
the subsingleton criterion, or give a proof script that works because it does.
Explain why it satisfies it or not.
P, Q: Prop(P /\ Q -> P * Q) * (P * Q -> P /\ Q)P, Q: Prop(P /\ Q -> P * Q) * (P * Q -> P /\ Q)P, Q: PropP /\ Q -> P * QP, Q: PropP * Q -> P /\ QP, Q: PropP /\ Q -> P * QP, Q: Prop
p: P
q: QP * Qall: assumption.P, Q: Prop
p: P
q: QPP, Q: Prop
p: P
q: QQP, Q: PropP * Q -> P /\ QP, Q: Prop
p: P
q: QP /\ Qall: assumption. Qed.P, Q: Prop
p: P
q: QPP, Q: Prop
p: P
q: QQ
Answer. Conjunction does satisfy the subsingleton criterion:
It has exactly one constructor
conj(so in particular at most one).conjhas two argumentsp : Pandq : Qthat are proofs, so in particular all its non-parameter arguments are proofs.
Exercise: Singleton version of le
Propose a version of le that satisfies the singleton criterion
(in particular, make sure it is defined in Prop).
You can use the goal below with le (<=) and with your le'.
It should only work with le'.
Is it satisfying? If not you can try and think if you can't define one
(perhaps not with the Inductive keyword) that works a bit better.
Be warned: you probably won't be satisfied either.
forall n m : nat, n <= m -> natforall n m : nat, n <= m -> natn, m: nat
h: n <= mnatAbort.n, m: nat
h: n <= mnatforall n m : nat, le' n m -> natforall n m : nat, le' n m -> natn, m: nat
h: le' n mnatn, m: nat
H: n = m \/ le' n (Init.Nat.pred m)nat
We can't actually do much, it's a bit like Box in the end.
Abort.Alternatively we can define le with a fixed point to actually extract info.
Fixpoint le_alt (n m : nat) : Prop :=
match n, m with
| 0, _ => True
| S n, 0 => False
| S n, S m => le_alt n m
end.But then, we're not really destructing the proof, but rather the natural numbers. In particular, we can't perform induction on the proof itself.
Fixpoint le_dec n m : { le_alt n m } + { ~ le_alt n m } :=
match n, m with
| 0, _ => left I
| S n, 0 => right (fun x => x)
| S n, S m => le_dec n m
end.Exercise: Binary trees
Define an inductive type bintree' for binary trees.
Write down both type and term for bintree_rect' (the induction principle
with Type-valued motive) manually.
Inductive bintree' A := | bt_leaf' (a : A) | bt_node' (a : A) (l r : bintree' A). Arguments bt_leaf' {A}. Arguments bt_node' {A}. Fixpoint bintree_rect' {A} (P : bintree' A -> Type) (hl : forall a, P (bt_leaf' a)) (hn : forall a l, P l -> forall r, P r -> P (bt_node' a l r)) (t : bintree' A) : P t := match t with | bt_leaf' a => hl a | bt_node' a l r => hn _ _ (bintree_rect' P hl hn l) _ (bintree_rect' P hl hn r) end.
Exercise: Map on binary trees
Define a map function for it, and show mapping with the identity results in the identity on binary trees.
Fixpoint bt_map' {A B} (f : A -> B) (t : bintree' A) : bintree' B := match t with | bt_leaf' a => bt_leaf' (f a) | bt_node' a l r => bt_node' (f a) (bt_map' f l) (bt_map' f r) end.forall (A : Type) (t : bintree' A), bt_map' (fun x : A => x) t = tforall (A : Type) (t : bintree' A), bt_map' (fun x : A => x) t = tA: Type
t: bintree' Abt_map' (fun x : A => x) t = tA: Type
a: Abt_map' (fun x : A => x) (bt_leaf' a) = bt_leaf' aA: Type
a: A
l, r: bintree' A
ihl: bt_map' (fun x : A => x) l = l
ihr: bt_map' (fun x : A => x) r = rbt_map' (fun x : A => x) (bt_node' a l r) = bt_node' a l rreflexivity.A: Type
a: Abt_map' (fun x : A => x) (bt_leaf' a) = bt_leaf' aA: Type
a: A
l, r: bintree' A
ihl: bt_map' (fun x : A => x) l = l
ihr: bt_map' (fun x : A => x) r = rbt_map' (fun x : A => x) (bt_node' a l r) = bt_node' a l rA: Type
a: A
l, r: bintree' A
ihl: bt_map' (fun x : A => x) l = l
ihr: bt_map' (fun x : A => x) r = rbt_node' a (bt_map' (fun x : A => x) l) (bt_map' (fun x : A => x) r) = bt_node' a l rreflexivity. Qed.A: Type
a: A
l, r: bintree' A
ihl: bt_map' (fun x : A => x) l = l
ihr: bt_map' (fun x : A => x) r = rbt_node' a l r = bt_node' a l r
Exercise: Induction principle for indexed type
Define an inductive type dtree A : nat -> Type for binary trees indexed by
their depth. State and prove (with a term) its Type-valued induction
principle.
Inductive dtree A | : nat -> Type := | dleaf (a : A) : dtree 0 | dnode {n m} (a : A) (l : dtree n) (r : dtree m) : dtree (max n m). Arguments dleaf {A}. Arguments dnode {A n m}.
Fixpoint dtree_rect' {A} (P : forall n, dtree A n -> Type) (hl : forall a, P 0 (dleaf a)) (hn : forall n m a l, P n l -> forall r, P m r -> P _ (dnode a l r)) n (t : dtree A n) : P n t := match t with | dleaf a => hl a | @dnode _ n m a l r => hn _ _ _ _ (dtree_rect' P hl hn n l) _ (dtree_rect' P hl hn m r) end. (* From the lecture: *) Scheme All for list. Inductive tree A := | node (a : A) (children : list (tree A)). Arguments node {A}. Fixpoint tree_map {A B} (f : A -> B) (t : tree A) : tree B := match t with | node a l => node (f a) (map (tree_map f) l) end.
Exercise: Using list_all
Prove the following lemma.
A: Type
t: tree Atree_map (fun x : A => x) t = tA: Type
t: tree Atree_map (fun x : A => x) t = tA: Type
a: A
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) ltree_map (fun x : A => x) (node a l) = node a lA: Type
a: A
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) lnode a (map (tree_map (fun x : A => x)) l) = node a lA: Type
a: A
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) lmap (tree_map (fun x : A => x)) l = lA: Type
a: Amap (tree_map (fun x : A => x)) [] = []A: Type
a: A
a0: tree A
p: tree_map (fun x : A => x) a0 = a0
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) l
IHih: map (tree_map (fun x : A => x)) l = lmap (tree_map (fun x : A => x)) (a0 :: l) = a0 :: lreflexivity.A: Type
a: Amap (tree_map (fun x : A => x)) [] = []A: Type
a: A
a0: tree A
p: tree_map (fun x : A => x) a0 = a0
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) l
IHih: map (tree_map (fun x : A => x)) l = lmap (tree_map (fun x : A => x)) (a0 :: l) = a0 :: lA: Type
a: A
a0: tree A
p: tree_map (fun x : A => x) a0 = a0
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) l
IHih: map (tree_map (fun x : A => x)) l = ltree_map (fun x : A => x) a0 :: map (tree_map (fun x : A => x)) l = a0 :: lall: assumption. Qed.A: Type
a: A
a0: tree A
p: tree_map (fun x : A => x) a0 = a0
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) l
IHih: map (tree_map (fun x : A => x)) l = ltree_map (fun x : A => x) a0 = a0A: Type
a: A
a0: tree A
p: tree_map (fun x : A => x) a0 = a0
l: list (tree A)
ih: list_all (tree A) (fun t : tree A => tree_map (fun x : A => x) t = t) l
IHih: map (tree_map (fun x : A => x)) l = lmap (tree_map (fun x : A => x)) l = l
Exercise: Nested induction principle by hand
You already had an exercise about defining a nice induction principle for tree
using Forall (which is the special case of list_all for Prop-valued
predicates).
To switch things up we'll be using a different method, using In.
State and prove the induction principle for tree called tree_ind_in.
You will likely have to use the fix tactic, and probably the revert tactic
to generalise the goal (revert x is basically the opposite of intro x).
forall (A : Type) (P : tree A -> Prop), (forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)) -> forall t : tree A, P tforall (A : Type) (P : tree A -> Prop), (forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)) -> forall t : tree A, P tA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)forall t : tree A, P tA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P tforall t : tree A, P tA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
l: list (tree A)P (node a l)A: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
l: list (tree A)forall x : tree A, In x l -> P xA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: Aforall (l : list (tree A)) (x : tree A), In x l -> P xA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P xforall (l : list (tree A)) (x : tree A), In x l -> P xA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
l: list (tree A)forall x : tree A, In x l -> P xA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P xforall x : tree A, In x [] -> P xA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)forall x0 : tree A, In x0 (x :: l) -> P x0A: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P xforall x : tree A, In x [] -> P xdestruct Hy.A: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
y: tree A
Hy: In y []P yA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)forall x0 : tree A, In x0 (x :: l) -> P x0A: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)
y: tree A
Hy: In y (x :: l)P yA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)P xA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)
y: tree A
Hy: In y lP yapply ind.A: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)P xA: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)
y: tree A
Hy: In y lP yassumption. Qed.A: Type
P: tree A -> Prop
h: forall (a : A) (l : list (tree A)), (forall x : tree A, In x l -> P x) -> P (node a l)
ind: forall t : tree A, P t
a: A
aux: forall (l : list (tree A)) (x : tree A), In x l -> P x
x: tree A
l: list (tree A)
y: tree A
Hy: In y lIn y l
You can add using tree_ind_in to an induction command to instruct Rocq to
use your custom induction principle instead.
Use it to prove the following.
A: Type
t: tree Atree_map (fun x : A => x) t = tA: Type
t: tree Atree_map (fun x : A => x) t = tA: Type
a: A
l: list (tree A)
ih: forall x : tree A, In x l -> tree_map (fun x0 : A => x0) x = xtree_map (fun x : A => x) (node a l) = node a lA: Type
a: A
l: list (tree A)
ih: forall x : tree A, In x l -> tree_map (fun x0 : A => x0) x = xnode a (map (tree_map (fun x : A => x)) l) = node a lA: Type
a: A
l: list (tree A)
ih: forall x : tree A, In x l -> tree_map (fun x0 : A => x0) x = xmap (tree_map (fun x : A => x)) l = lA: Type
a: A
l: list (tree A)
ih: forall x : tree A, In x l -> tree_map (fun x0 : A => x0) x = xmap ?g l = lA: Type
a: A
l: list (tree A)
ih: forall x : tree A, In x l -> tree_map (fun x0 : A => x0) x = xforall a0 : tree A, In a0 l -> tree_map (fun x : A => x) a0 = ?g a0apply map_id.A: Type
a: A
l: list (tree A)
ih: forall x : tree A, In x l -> tree_map (fun x0 : A => x0) x = xmap ?g l = lfirstorder. Qed.A: Type
a: A
l: list (tree A)
ih: forall x : tree A, In x l -> tree_map (fun x0 : A => x0) x = xforall a0 : tree A, In a0 l -> tree_map (fun x : A => x) a0 = (fun x : tree A => x) a0
Exercise: Strong induction on natural numbers
We have seen strong induction on nat already, but show it again and use it to
prove the following lemma that corresponds to induction on natural numbers with
access to the two previous cases.
forall P : nat -> Prop, (forall n : nat, (forall m : nat, m < n -> P m) -> P n) -> forall n : nat, P nforall P : nat -> Prop, (forall n : nat, (forall m : nat, m < n -> P m) -> P n) -> forall n : nat, P nP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: natP nP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: natforall m : nat, m < n -> P mP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P nforall m : nat, m < 0 -> P mP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P mforall m : nat, m < S n -> P mP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P nforall m : nat, m < 0 -> P minversion hm.P: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
m: nat
hm: m < 0P mP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P mforall m : nat, m < S n -> P mP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P m
m: nat
hm: m < S nP mP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P m
m: nat
hm: m < S n
H0: m = nP nP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P m
m: nat
hm: m < S n
m0: nat
H0: S m <= n
H: m0 = nP mP: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P m
m: nat
hm: m < S n
H0: m = nP nassumption.P: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P m
m: nat
hm: m < S n
H0: m = nforall m0 : nat, m0 < n -> P m0P: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P m
m: nat
hm: m < S n
m0: nat
H0: S m <= n
H: m0 = nP mlia. Qed.P: nat -> Prop
h: forall n : nat, (forall m : nat, m < n -> P m) -> P n
n: nat
ih: forall m : nat, m < n -> P m
m: nat
hm: m < S n
m0: nat
H0: S m <= n
H: m0 = nm < nforall P : nat -> Prop, P 0 -> P 1 -> (forall n : nat, P n -> P (S n) -> P (S (S n))) -> forall n : nat, P nforall P : nat -> Prop, P 0 -> P 1 -> (forall n : nat, P n -> P (S n) -> P (S (S n))) -> forall n : nat, P nP: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: natP nP: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: nat
ih: forall m : nat, m < n -> P mP nP: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
ih: forall m : nat, m < 0 -> P mP 0P: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
ih: forall m : nat, m < 1 -> P mP 1P: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: nat
ih: forall m : nat, m < S (S n) -> P mP (S (S n))P: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: nat
ih: forall m : nat, m < S (S n) -> P mP (S (S n))P: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: nat
ih: forall m : nat, m < S (S n) -> P mP nP: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: nat
ih: forall m : nat, m < S (S n) -> P mP (S n)all: lia. Qed.P: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: nat
ih: forall m : nat, m < S (S n) -> P mn < S (S n)P: nat -> Prop
h0: P 0
h1: P 1
hSS: forall n : nat, P n -> P (S n) -> P (S (S n))
n: nat
ih: forall m : nat, m < S (S n) -> P mS n < S (S n)
Exercise: Fibonacci
Use the induction tactic with nat_ind_2 to prove that the Fibonacci
sequence is always above its index (n <= fib n).
Fixpoint fib n := match n with | 0 => 1 | 1 => 1 | S (S n as m) => fib n + fib m end.forall n : nat, n <= fib nforall n : nat, n <= fib nn: natn <= fib n0 <= fib 01 <= fib 1n: nat
hn: n <= fib n
hSn: S n <= fib (S n)S (S n) <= fib (S (S n))0 <= fib 0auto.0 <= 11 <= fib 1auto.1 <= 1n: nat
hn: n <= fib n
hSn: S n <= fib (S n)S (S n) <= fib (S (S n))n: nat
hn: n <= fib n
hSn: S n <= fib (S n)S (S n) <= fib n + fib (S n)hn: 0 <= fib 0
hSn: 1 <= fib 12 <= fib 0 + fib 1n: nat
hn: S n <= fib (S n)
hSn: S (S n) <= fib (S (S n))S (S (S n)) <= fib (S n) + fib (S (S n))hn: 0 <= fib 0
hSn: 1 <= fib 12 <= fib 0 + fib 1auto.hn: 0 <= fib 0
hSn: 1 <= fib 12 <= 2lia. Qed.n: nat
hn: S n <= fib (S n)
hSn: S (S n) <= fib (S (S n))S (S (S n)) <= fib (S n) + fib (S (S n))
Exercise: No infinite decreasing sequence
You might be surprised that our definition of well-foundedness isn't talking about the absence of infinite decreasing sequences. While that is the usual definition, in our setting such a definition doesn't let us construct terms in general, so it is better to have a positive outlook on well-foundedness.
We can still connect the two though! Prove the following lemmas.
Section Sequences. Context (A : Type) (R : A -> A -> Prop). Definition noseq_from x := ~ (exists (u : nat -> A), u 0 = x /\ forall n, R (u (S n)) (u n)).A: Type
R: A -> A -> Prop
x: AAcc R x -> noseq_from xA: Type
R: A -> A -> Prop
x: AAcc R x -> noseq_from xA: Type
R: A -> A -> Prop
x: A
h: Acc R xnoseq_from xA: Type
R: A -> A -> Prop
x: A
h: forall y : A, R y x -> Acc R y
ih: forall y : A, R y x -> noseq_from ynoseq_from xA: Type
R: A -> A -> Prop
u: nat -> A
ih: forall y : A, R y (u 0) -> noseq_from y
h: forall y : A, R y (u 0) -> Acc R y
hu: forall n : nat, R (u (S n)) (u n)FalseA: Type
R: A -> A -> Prop
u: nat -> A
ih: forall y : A, R y (u 0) -> noseq_from y
h: forall y : A, R y (u 0) -> Acc R y
hu: forall n : nat, R (u (S n)) (u n)R ?y (u 0)A: Type
R: A -> A -> Prop
u: nat -> A
ih: forall y : A, R y (u 0) -> noseq_from y
h: forall y : A, R y (u 0) -> Acc R y
hu: forall n : nat, R (u (S n)) (u n)exists u0 : nat -> A, u0 0 = ?y /\ (forall n : nat, R (u0 (S n)) (u0 n))apply hu.A: Type
R: A -> A -> Prop
u: nat -> A
ih: forall y : A, R y (u 0) -> noseq_from y
h: forall y : A, R y (u 0) -> Acc R y
hu: forall n : nat, R (u (S n)) (u n)R ?y (u 0)A: Type
R: A -> A -> Prop
u: nat -> A
ih: forall y : A, R y (u 0) -> noseq_from y
h: forall y : A, R y (u 0) -> Acc R y
hu: forall n : nat, R (u (S n)) (u n)exists u0 : nat -> A, u0 0 = u 1 /\ (forall n : nat, R (u0 (S n)) (u0 n))firstorder. Qed.A: Type
R: A -> A -> Prop
u: nat -> A
ih: forall y : A, R y (u 0) -> noseq_from y
h: forall y : A, R y (u 0) -> Acc R y
hu: forall n : nat, R (u (S n)) (u n)u 1 = u 1 /\ (forall n : nat, R (u (S (S n))) (u (S n)))
End Sequences. From Stdlib Require Import Lia.
Exercise: Search using Acc
We are going to show that for any decidable predicate P with
exists n, P n we can compute a natural number n for which P holds,
i.e. deduce { n | P n }.
Prove the admitted lemmas below.
Section ConstructiveIndefiniteGroundDescription_Acc. Context (P : nat -> Prop). Hypothesis P_decidable : forall n : nat, {P n} + {~ P n}. Let R (x y : nat) : Prop := x = S y /\ ~ P y. Local Abbreviation acc x := (Acc R x).P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propforall x : nat, P x -> acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propforall x : nat, P x -> acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
H: P xacc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
H: P xforall y : nat, R y x -> acc yabsurd (P x); assumption. Qed.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
H: P x
y: nat
not_Px: ~ P xacc yP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propforall x n : nat, P (n + x) -> acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propforall x n : nat, P (n + x) -> acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propforall x : nat, P x -> acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc xforall x : nat, P (S (n + x)) -> acc xapply P_implies_acc.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propforall x : nat, P x -> acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc xforall x : nat, P (S (n + x)) -> acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc x
x: nat
H: P (S (n + x))acc xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc x
x: nat
H: P (S (n + x))forall y : nat, R y x -> acc yP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc x
x: nat
H: P (S (n + x))
y: nat
fxy: y = S xacc yP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc x
x: nat
H: P (S (n + x))
y: nat
fxy: y = S xP (n + y)P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc x
x: nat
H: P (S (n + x))
y: nat
fxy: y = S xP (n + S x)assumption. Qed.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
n: nat
IH: forall x : nat, P (n + x) -> acc x
x: nat
H: P (S (n + x))
y: nat
fxy: y = S xP (S (n + x))P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop(exists n : nat, P n) -> acc 0P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop(exists n : nat, P n) -> acc 0P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
H: exists n : nat, P nforall x : nat, P x -> acc 0P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
H: exists n : nat, P n
x: nat
Px: P xacc 0P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
H: exists n : nat, P n
x: nat
Px: P xP (x + 0)assumption. Qed.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
H: exists n : nat, P n
x: nat
Px: P xP xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propacc 0 -> {n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Propacc 0 -> {n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
Acc_0: acc 0{n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
Acc_0: acc 0(fun _ : nat => {n : nat | P n}) 0P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
Acc_0: acc 0forall x : nat, (forall y : nat, R y x -> {n : nat | P n}) -> {n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}{n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
Px: P x{n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x{n : nat | P n}exists x; simpl; assumption.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
Px: P x{n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x{n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x
y:= S x: nat{n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x
y:= S x: natR y xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x
y:= S x: nat
Ryx: R y x{n : nat | P n}unfold R; split; auto.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x
y:= S x: natR y xP: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x
y:= S x: nat
Ryx: R y x{n : nat | P n}exists n; assumption. Qed.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
x: nat
IH: forall y : nat, R y x -> {n : nat | P n}
not_Px: ~ P x
y:= S x: nat
Ryx: R y x
n: nat
Hn: P n{n0 : nat | P n0}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop(exists n : nat, P n) -> {n : nat | P n}P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop(exists n : nat, P n) -> {n : nat | P n}apply P_eventually_implies_acc_ex; assumption. Qed. End ConstructiveIndefiniteGroundDescription_Acc.P: nat -> Prop
P_decidable: forall n : nat, {P n} + {~ P n}
R:= fun x y : nat => x = S y /\ ~ P y: nat -> nat -> Prop
H: exists n : nat, P nacc 0
Exercise: Defining functions by well-founded recursion
We have seen well-founded induction, but sometimes we also want to define
functions by well-founded recursion.
The standard library comes with a helpful function for doing that called
Fix_F. It performs induction on accessibility like we have been doing.
Implement a merge function on lists such that if l and r are
individually sorted, then merge l r should be sorted too.
This function is the main ingredient for the merge sort algorithm.
We give you the version one would write in OCaml and you have to adapt it into a function accepted by Rocq. We're using lists of natural numbers to make it simpler but it could be generalised of course.
Next, prove a specification for merge that ensures it preserves sortedness
and that the result is a permutation of the original lists. You can use a
weak version of permutation that doesn't account for multiplicity.
We give you some lemmas about sorted and wpermut that you may or may not
use.
This is so you don't waste too much time on those. We expect you to begin
by admitting them, but you should be able to prove them.
From Stdlib Require Import RelationClasses.Inductive sorted : list nat -> Prop := | sorted_nil : sorted [] | sorted_cons : forall x l, sorted l -> Forall (le x) l -> sorted (x :: l). Definition wpermut (l r : list nat) : Prop := forall x, In x l <-> In x r.forall (A : Type) (R : A -> A -> Prop) (P : forall a : A, Acc R a -> Type), (forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)) -> forall (x : A) (a : Acc R x), P x aforall (A : Type) (R : A -> A -> Prop) (P : forall a : A, Acc R a -> Type), (forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)) -> forall (x : A) (a : Acc R x), P x aA: Type
R: A -> A -> Prop
P: forall a : A, Acc R a -> Type
h: forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)forall (x : A) (a : Acc R x), P x aA: Type
R: A -> A -> Prop
P: forall a : A, Acc R a -> Type
h: forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)
ind: forall (x : A) (a : Acc R x), P x aforall (x : A) (a : Acc R x), P x aA: Type
R: A -> A -> Prop
P: forall a : A, Acc R a -> Type
h: forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)
ind: forall (x : A) (a : Acc R x), P x a
x: A
a: Acc R xP x aA: Type
R: A -> A -> Prop
P: forall a : A, Acc R a -> Type
h: forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)
ind: forall (x : A) (a : Acc R x), P x a
x: A
ha: forall y : A, R y x -> Acc R yP x (Acc_intro x ha)A: Type
R: A -> A -> Prop
P: forall a : A, Acc R a -> Type
h: forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)
ind: forall (x : A) (a : Acc R x), P x a
x: A
ha: forall y : A, R y x -> Acc R yforall (y : A) (hy : R y x), P y (ha y hy)apply ind. Defined.A: Type
R: A -> A -> Prop
P: forall a : A, Acc R a -> Type
h: forall (x : A) (h : forall y : A, R y x -> Acc R y), (forall (y : A) (hy : R y x), P y (h y hy)) -> P x (Acc_intro x h)
ind: forall (x : A) (a : Acc R x), P x a
x: A
ha: forall y : A, R y x -> Acc R y
y: A
hy: R y xP y (ha y hy)Reflexive wpermutReflexive wpermutreflexivity. Qed.l: list nat
x: natIn x l <-> In x lSymmetric wpermutSymmetric wpermutl, r: list nat
h: wpermut l r
x: natIn x r <-> In x lapply h. Qed.l, r: list nat
h: wpermut l r
x: natIn x l <-> In x rTransitive wpermutTransitive wpermuta, b, c: list nat
h1: wpermut a b
h2: wpermut b c
x: natIn x a <-> In x ca, b, c: list nat
h1: wpermut a b
h2: wpermut b c
x: natIn x a <-> In x ba, b, c: list nat
h1: wpermut a b
h2: wpermut b c
x: natIn x b <-> In x capply h1.a, b, c: list nat
h1: wpermut a b
h2: wpermut b c
x: natIn x a <-> In x bapply h2. Qed. Add Parametric Relation : (list nat) wpermut as wpermut_rel.a, b, c: list nat
h1: wpermut a b
h2: wpermut b c
x: natIn x b <-> In x cforall (P : nat -> Prop) (l r : list nat), wpermut l r -> Forall P r -> Forall P lforall (P : nat -> Prop) (l r : list nat), wpermut l r -> Forall P r -> Forall P lP: nat -> Prop
l, r: list nat
hp: wpermut l r
h: Forall P rForall P lP: nat -> Prop
l, r: list nat
hp: wpermut l r
h: Forall P rforall x : nat, In x l -> P xP: nat -> Prop
l, r: list nat
hp: wpermut l r
h: forall x : nat, In x r -> P xforall x : nat, In x l -> P xP: nat -> Prop
l, r: list nat
hp: wpermut l r
h: forall x : nat, In x r -> P x
x: nat
hx: In x lP xP: nat -> Prop
l, r: list nat
hp: forall x : nat, In x l <-> In x r
h: forall x : nat, In x r -> P x
x: nat
hx: In x lP xauto. Qed.P: nat -> Prop
l, r: list nat
hp: forall x : nat, In x l <-> In x r
h: forall x : nat, In x r -> P x
x: nat
hx: In x rP xforall (x : nat) (l r : list nat), wpermut l r -> wpermut (x :: l) (x :: r)forall (x : nat) (l r : list nat), wpermut l r -> wpermut (x :: l) (x :: r)x: nat
l, r: list nat
h: wpermut l rwpermut (x :: l) (x :: r)x: nat
l, r: list nat
h: forall x : nat, In x l <-> In x rforall x0 : nat, In x0 (x :: l) <-> In x0 (x :: r)x: nat
l, r: list nat
h: forall x : nat, In x l <-> In x rforall x0 : nat, x = x0 \/ In x0 l <-> x = x0 \/ In x0 rx: nat
l, r: list nat
h: forall x : nat, In x l <-> In x r
y: natx = y \/ In y l <-> x = y \/ In y rreflexivity. Qed.x: nat
l, r: list nat
h: forall x : nat, In x l <-> In x r
y: natx = y \/ In y r <-> x = y \/ In y rforall l r : list nat, wpermut (l ++ r) (r ++ l)forall l r : list nat, wpermut (l ++ r) (r ++ l)l, r: list nat
x: natIn x (l ++ r) <-> In x (r ++ l)l, r: list nat
x: natIn x l \/ In x r <-> In x r \/ In x lreflexivity. Qed.l, r: list nat
x: natIn x r \/ In x l <-> In x r \/ In x lforall (x : nat) (l : list nat), sorted (x :: l) -> sorted l /\ Forall (le x) lforall (x : nat) (l : list nat), sorted (x :: l) -> sorted l /\ Forall (le x) lx: nat
l: list nat
h: sorted (x :: l)sorted l /\ Forall (le x) lauto. Qed. Section Merge. Let T := (list nat * list nat)%type. Let m (x : T) := length (fst x) + length (snd x). Let R (x y : T) := S (m x) = m y.x: nat
l: list nat
h: sorted (x :: l)
x0: nat
l0: list nat
H1: sorted l
H2: Forall (le x) l
H: x0 = x
H0: l0 = lsorted l /\ Forall (le x) lT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Propforall x : T, Acc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Propforall x : T, Acc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: TAcc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
n: nat
e: n = m xAcc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
e: 0 = m xAcc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
n: nat
e: S n = m x
ih: forall x : T, n = m x -> Acc R xAcc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
e: 0 = m xAcc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
e: 0 = m xforall y : T, R y x -> Acc R yT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
e: 0 = m x
y: T
hr: R y xAcc R yT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
e: 0 = m x
y: T
hr: S (m y) = m xAcc R yinversion hr.T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
e: 0 = m x
y: T
hr: S (m y) = 0Acc R yT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
n: nat
e: S n = m x
ih: forall x : T, n = m x -> Acc R xAcc R xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
n: nat
e: S n = m x
ih: forall x : T, n = m x -> Acc R xforall y : T, R y x -> Acc R yT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
n: nat
e: S n = m x
ih: forall x : T, n = m x -> Acc R x
y: T
hr: R y xAcc R yT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
n: nat
e: S n = m x
ih: forall x : T, n = m x -> Acc R x
y: T
hr: S (m y) = m xAcc R ylia. Qed.T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: T
n: nat
e: S n = m x
ih: forall x : T, n = m x -> Acc R x
y: T
hr: S (m y) = m xn = m yT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Propforall (x y : nat) (l r : list nat), R (x :: l, r) (x :: l, y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Propforall (x y : nat) (l r : list nat), R (x :: l, r) (x :: l, y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x, y: nat
l, r: list natR (x :: l, r) (x :: l, y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x, y: nat
l, r: list natS (m (x :: l, r)) = m (x :: l, y :: r)lia. Qed. Definition merge (x : T) : list nat := Fix_F _ (fun x rec => match x with | ([], l) | (l, []) => fun rec => l | (x :: l, y :: r) => fun (rec : forall z, R z (x :: l, y :: r) -> list nat) => if x <? y then x :: rec (l, y :: r) eq_refl else y :: rec (x :: l, r) (R_step2 _ _ _ _) end rec ) (merge_acc x).T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x, y: nat
l, r: list natS (S (length l + length r)) = S (length l + S (length r))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Propforall l r : list nat, sorted l -> sorted r -> sorted (merge (l, r)) /\ wpermut (merge (l, r)) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Propforall l r : list nat, sorted l -> sorted r -> sorted (merge (l, r)) /\ wpermut (merge (l, r)) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted rsorted (merge (l, r)) /\ wpermut (merge (l, r)) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted rsorted (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) (merge_acc (l, r))) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) (merge_acc (l, r))) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted r
a:= merge_acc (l, r): Acc R (l, r)sorted (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) a) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) a) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted r
a: Acc R (l, r)sorted (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) a) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) a) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted r
t: list nat * list nat
e: t = (l, r)
a: Acc R tsorted (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) a) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) (fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l0, l1) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l0 as l2 return (forall z : T, R z (l2, l1) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l1) -> list nat => l1 | x0 :: l2 => match l1 as l3 return (forall z : T, R z (x0 :: l2, l3) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l2, []) -> list nat => l0 | y :: r0 => fun rec0 : forall z : T, R z (x0 :: l2, y :: r0) -> list nat => if x0 <? y then x0 :: rec0 (l2, y :: r0) eq_refl else y :: rec0 (x0 :: l2, r0) (R_step2 x0 y l2 r0) end end) rec) a) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted r
t: list nat * list nat
e: t = (l, r)
a: Acc R t
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list natsorted (Fix_F (fun _ : list nat * list nat => list nat) F a) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F a) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted r
t: T
e: t = (l, r)
h: forall y : T, R y t -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y t) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)sorted (Fix_F (fun _ : list nat * list nat => list nat) F (Acc_intro t h)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (Acc_intro t h)) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted r
t: T
e: t = (l, r)
h: forall y : T, R y t -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y t) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)sorted (F t (fun (y : list nat * list nat) (h0 : R y t) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) /\ wpermut (F t (fun (y : list nat * list nat) (h0 : R y t) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
l, r: list nat
hl: sorted l
hr: sorted r
h: forall y : T, R y (l, r) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y (l, r)) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)sorted (F (l, r) (fun (y : list nat * list nat) (h0 : R y (l, r)) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) /\ wpermut (F (l, r) (fun (y : list nat * list nat) (h0 : R y (l, r)) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) (l ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
hl, hr: sorted []
h: forall y : T, R y ([], []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y ([], [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)sorted (F ([], []) (fun (y : list nat * list nat) (h0 : R y ([], [])) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) /\ wpermut (F ([], []) (fun (y : list nat * list nat) (h0 : R y ([], [])) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) ([] ++ [])T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
y: nat
r: list nat
hl: sorted []
hr: sorted (y :: r)
h: forall y0 : T, R y0 ([], y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 ([], y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)sorted (F ([], y :: r) (fun (y0 : list nat * list nat) (h0 : R y0 ([], y :: r)) => Fix_F (fun _ : list nat * list nat => list nat) F (h y0 h0))) /\ wpermut (F ([], y :: r) (fun (y0 : list nat * list nat) (h0 : R y0 ([], y :: r)) => Fix_F (fun _ : list nat * list nat => list nat) F (h y0 h0))) ([] ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
hl: sorted (x :: l)
hr: sorted []
h: forall y : T, R y (x :: l, []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y (x :: l, [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)sorted (F (x :: l, []) (fun (y : list nat * list nat) (h0 : R y (x :: l, [])) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) /\ wpermut (F (x :: l, []) (fun (y : list nat * list nat) (h0 : R y (x :: l, [])) => Fix_F (fun _ : list nat * list nat => list nat) F (h y h0))) ((x :: l) ++ [])T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)sorted (F (x :: l, y :: r) (fun (y0 : list nat * list nat) (h0 : R y0 (x :: l, y :: r)) => Fix_F (fun _ : list nat * list nat => list nat) F (h y0 h0))) /\ wpermut (F (x :: l, y :: r) (fun (y0 : list nat * list nat) (h0 : R y0 (x :: l, y :: r)) => Fix_F (fun _ : list nat * list nat => list nat) F (h y0 h0))) ((x :: l) ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
hl, hr: sorted []
h: forall y : T, R y ([], []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y ([], [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)sorted [] /\ wpermut [] []T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
y: nat
r: list nat
hl: sorted []
hr: sorted (y :: r)
h: forall y0 : T, R y0 ([], y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 ([], y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)sorted (y :: r) /\ wpermut (y :: r) (y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
hl: sorted (x :: l)
hr: sorted []
h: forall y : T, R y (x :: l, []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y (x :: l, [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)sorted (x :: l) /\ wpermut (x :: l) (x :: l ++ [])T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)sorted (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
hl, hr: sorted []
h: forall y : T, R y ([], []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y ([], [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)wpermut [] []T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
y: nat
r: list nat
hl: sorted []
hr: sorted (y :: r)
h: forall y0 : T, R y0 ([], y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 ([], y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)wpermut (y :: r) (y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
hl: sorted (x :: l)
hr: sorted []
h: forall y : T, R y (x :: l, []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y (x :: l, [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)wpermut (x :: l) (x :: l ++ [])T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)sorted (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
hl, hr: sorted []
h: forall y : T, R y ([], []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y ([], [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)wpermut [] []T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
y: nat
r: list nat
hl: sorted []
hr: sorted (y :: r)
h: forall y0 : T, R y0 ([], y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 ([], y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)wpermut (y :: r) (y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
hl: sorted (x :: l)
hr: sorted []
h: forall y : T, R y (x :: l, []) -> Acc R y
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y : T) (hy : R y (x :: l, [])) (l r : list nat), sorted l -> sorted r -> y = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y hy)) (l ++ r)wpermut (x :: l) (x :: l)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)sorted (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)sorted (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (if x <? y then x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl) else y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) /\ wpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) /\ wpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) /\ wpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall hy : R (l, y :: r) (x :: l, y :: r), sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) hy)) (l ++ y :: r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) /\ wpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) /\ wpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) /\ wpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truewpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truesorted (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truesorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = trueForall (le x) (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = trueForall (le x) (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truewpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) ?rT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = trueForall (le x) ?rT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = trueForall (le x) (l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = trueForall (le x) (l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = trueForall (le x) l /\ Forall (le x) (y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = trueForall (le x) (y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: S x <= yForall (le x) (y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: S x <= yx <= yT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: S x <= yForall (le x) rT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: S x <= yForall (le x) rT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: S x <= yforall a : nat, ?P a -> x <= aT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: S x <= yForall ?P rlia.T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: S x <= yforall a : nat, y <= a -> x <= aT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truewpermut (x :: Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (x :: l ++ y :: r)assumption.T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)
e: (x <? y) = truewpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (l, y :: r) eq_refl)) (l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall (y0 : T) (hy : R y0 (x :: l, y :: r)) (l r : list nat), sorted l -> sorted r -> y0 = (l, r) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h y0 hy)) (l ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: forall l0 r0 : list nat, sorted l0 -> sorted r0 -> (x :: l, r) = (l0, r0) -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (l0 ++ r0)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted (y :: r)
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: sorted (x :: l) -> sorted r -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: sorted (x :: l) -> sorted r -> sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ih: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) /\ wpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsesorted (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsesorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falseForall (le y) (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falseForall (le y) (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ?rT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falseForall (le y) ?rT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falseForall (le y) ((x :: l) ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falseForall (le y) ((x :: l) ++ r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falseForall (le y) (x :: l) /\ Forall (le y) rT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falseForall (le y) (x :: l)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: y <= xForall (le y) (x :: l)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: y <= xy <= xT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: y <= xForall (le y) lT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: y <= xForall (le y) lT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: y <= xforall a : nat, ?P a -> y <= aT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: y <= xForall ?P llia.T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted l
hxl: Forall (le x) l
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: y <= xforall a : nat, x <= a -> y <= aT:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (x :: l ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ y :: r)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((y :: r) ++ x :: l)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (y :: Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (y :: r ++ x :: l)T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) (r ++ x :: l)assumption. Qed. End Merge.T:= (list nat * list nat)%type: Set
m:= fun x : T => length (fst x) + length (snd x): T -> nat
R:= fun x y : T => S (m x) = m y: T -> T -> Prop
x: nat
l: list nat
y: nat
r: list nat
hl: sorted (x :: l)
hr: sorted r
hyr: Forall (le y) r
h: forall y0 : T, R y0 (x :: l, y :: r) -> Acc R y0
F:= fun (x : list nat * list nat) (rec : forall y : list nat * list nat, R y x -> list nat) => (let (l, l0) as x0 return (forall z : T, R z x0 -> list nat) -> list nat := x in match l as l1 return (forall z : T, R z (l1, l0) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z ([], l0) -> list nat => l0 | x0 :: l1 => match l0 as l2 return (forall z : T, R z (x0 :: l1, l2) -> list nat) -> list nat with | [] => fun _ : forall z : T, R z (x0 :: l1, []) -> list nat => l | y :: r => fun rec0 : forall z : T, R z (x0 :: l1, y :: r) -> list nat => if x0 <? y then x0 :: rec0 (l1, y :: r) eq_refl else y :: rec0 (x0 :: l1, r) (R_step2 x0 y l1 r) end end) rec: forall x : list nat * list nat, (forall y : list nat * list nat, R y x -> list nat) -> list nat
ihs: sorted (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r)))
ihp: wpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
e: (x <? y) = falsewpermut (Fix_F (fun _ : list nat * list nat => list nat) F (h (x :: l, r) (R_step2 x y l r))) ((x :: l) ++ r)
Exercise: Hilbert's epsilon (advanced)
We're going to show the Bishop-Diaconescu-Myhill-Goodman theorem. It shows that the axiom of choice implies excluded middle with sufficient extensionality.
There are several versions of the axiom of choice. One is Hilbert's epsilon operator which takes a property on a type, and returns an element of that type that verifies the property if such an element exists. To avoid inconsistencies, we have to restrict this operator to inhabited types.
Section Hilbert.inhabited A is just a proposition from which you cannot extract the witness.
Context (epsilon : forall A, inhabited A -> (A -> Prop) -> A).
If there is an element verifying the property, then the one epsilon gave us
also verifies it.
Context (epsilon_spec : forall A i P, (exists x, P x) -> P (epsilon A i P)).
We also need some extensionality to tell us that the choice does not depend on how the property was formulated.
Context (epsilon_ext : forall A i P Q, (forall x, P x <-> Q x) -> epsilon A i P = epsilon A i Q ).
Prove the excluded middle.
epsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Qforall P : Prop, P \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Qforall P : Prop, P \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: PropP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited boolP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> PropP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> PropP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: boolP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: boolP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: boolB bepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B bP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: boolB bepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: boolexists x : bool, B xepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: boolB falsereflexivity.epsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: boolfalse = falseepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B bP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B bC cepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B b
hc: C cP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B bC cepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B bexists x : bool, C xepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B bC truereflexivity.epsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B btrue = trueepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hb: B b
hc: C cP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
hc: C cP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
hP: P
hc: C cP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
hc: C cP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = trueP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
hP: PP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = trueP \/ ~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true~ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: PFalseepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: Pb = cepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: P
e: b = cFalseepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: Pb = cepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: Pforall x : bool, B x <-> C xepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: P
x: boolB x <-> C xepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: P
x: boolx = false \/ P <-> x = true \/ Pall: auto.epsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: P
x: boolx = false \/ P -> x = true \/ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: P
x: boolx = true \/ P -> x = false \/ Pepsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: P
e: b = cFalsediscriminate. Qed. End Hilbert.epsilon: forall A : Type, inhabited A -> (A -> Prop) -> A
epsilon_spec: forall (A : Type) (i : inhabited A) (P : A -> Prop), (exists x : A, P x) -> P (epsilon A i P)
epsilon_ext: forall (A : Type) (i : inhabited A) (P Q : A -> Prop), (forall x : A, P x <-> Q x) -> epsilon A i P = epsilon A i Q
P: Prop
i:= inhabits true: inhabited bool
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
b:= epsilon bool i B: bool
c:= epsilon bool i C: bool
eb: b = false
ec: c = true
hP: P
e: false = trueFalse
Exercise: From relation to function (advanced)
Another version of the axiom of choice says that from an entire relation, one can extract a function. It's a form of inversion of quantifiers.
Definition fun_choice :=
forall A B (R : A -> B -> Prop),
(forall x, exists y, R x y) ->
exists (f : A -> B),
forall x, R x (f x).Show that fun_choice implies LEM as well.
You may use proposition and function extensionality.
The proof should share some ideas with the one above and could involve some
function of type { p : bool -> Prop | p = B \/ p = C } -> bool
with carefully chosen B and C.
Definition FunExt := forall A B (f g : A -> B), (forall x, f x = g x) -> f = g. Definition PropExt := forall (P Q : Prop), P <-> Q -> P = Q.fun_choice -> FunExt -> PropExt -> forall P : Prop, P \/ ~ Pfun_choice -> FunExt -> PropExt -> forall P : Prop, P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: PropP \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> PropP \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> PropP \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
eps: (forall x : {p : bool -> Prop | p = B \/ p = C}, exists y : bool, (fun (p : {p : bool -> Prop | p = B \/ p = C}) (b : bool) => proj1_sig p b) x y) -> exists f : {p : bool -> Prop | p = B \/ p = C} -> bool, forall x : {p : bool -> Prop | p = B \/ p = C}, (fun (p : {p : bool -> Prop | p = B \/ p = C}) (b : bool) => proj1_sig p b) x (f x)P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Propforall x : {p : bool -> Prop | p = B \/ p = C}, exists y : bool, proj1_sig x yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Propforall x : {p : bool -> Prop | p = B \/ p = C}, exists y : bool, proj1_sig x yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
p: bool -> Prop
eB: p = Bexists y : bool, proj1_sig (exist (fun p0 : bool -> Prop => p0 = B \/ p0 = C) p (or_introl eB)) yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
p: bool -> Prop
eC: p = Cexists y : bool, proj1_sig (exist (fun p0 : bool -> Prop => p0 = B \/ p0 = C) p (or_intror eC)) yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
p: bool -> Prop
eB: p = Bexists y : bool, proj1_sig (exist (fun p0 : bool -> Prop => p0 = B \/ p0 = C) p (or_introl eB)) yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Propexists y : bool, proj1_sig (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl eq_refl)) yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Propexists y : bool, B yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> PropB falsereflexivity.ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Propfalse = falseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
p: bool -> Prop
eC: p = Cexists y : bool, proj1_sig (exist (fun p0 : bool -> Prop => p0 = B \/ p0 = C) p (or_intror eC)) yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Propexists y : bool, proj1_sig (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror eq_refl)) yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Propexists y : bool, C yac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> PropC truereflexivity.ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Proptrue = trueac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
hfB: proj1_sig (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) (f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))))P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
hfB: B (f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))))P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
hfB: B (f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))))
hfC: proj1_sig (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) (f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))))P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
hfB: B (f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))))
hfC: C (f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))))P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
hfC: C (f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))))P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
hP: P
hfC: C (f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))))P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
hfC: C (f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))))P \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = trueP \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
hP: PP \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = trueP \/ ~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true~ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: PFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: PB = Cac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
e: B = CFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: PB = Cac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: Pforall x : bool, B x = C xac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
x: boolB x = C xac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
x: boolB x <-> C xac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
x: boolx = false \/ P <-> x = true \/ Pall: auto.ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
x: boolx = false \/ P -> x = true \/ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
x: boolx = true \/ P -> x = false \/ Pac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B:= fun x : bool => x = false \/ P: bool -> Prop
C:= fun x : bool => x = true \/ P: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
e: B = CFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
B, C: bool -> Prop
f: {p : bool -> Prop | p = B \/ p = C} -> bool
hf: forall x : {p : bool -> Prop | p = B \/ p = C}, proj1_sig x (f x)
eB: f (exist (fun p : bool -> Prop => p = B \/ p = C) B (or_introl (funext bool Prop B B (fun x : bool => eq_refl)))) = false
eC: f (exist (fun p : bool -> Prop => p = B \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
hP: P
e: B = CFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: PFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: Pforall (P0 : Prop) (p q : P0), p = qac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: Pforall (P0 : Prop) (p q : P0), p = qac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
Q: Prop
u, v: Qu = vac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
Q: Prop
u, v: QQ = Trueac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
Q: Prop
u, v: Q
H: Q = Trueu = vac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
Q: Prop
u, v: QQ = Truesplit ; auto.ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
Q: Prop
u, v: QQ <-> Trueac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
Q: Prop
u, v: Q
H: Q = Trueu = vac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
v, u: Trueu = vreflexivity.ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: PI = Iac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qtrue = falseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = q
H: true = falseFalseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qtrue = falseac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qf (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl))))ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qC = C \/ C = Cac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qC = C \/ C = Cac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qf (exist (fun p : bool -> Prop => p = C \/ p = C) C ?Goal1) = f (exist (fun p : bool -> Prop => p = C \/ p = C) C ?Goal2)auto.ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = qC = C \/ C = Cdiscriminate. Qed.ac: fun_choice
funext: FunExt
propext: PropExt
P: Prop
C: bool -> Prop
f: {p : bool -> Prop | p = C \/ p = C} -> bool
eC: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_intror (funext bool Prop C C (fun x : bool => eq_refl)))) = true
eB: f (exist (fun p : bool -> Prop => p = C \/ p = C) C (or_introl (funext bool Prop C C (fun x : bool => eq_refl)))) = false
hf: forall x : {p : bool -> Prop | p = C \/ p = C}, proj1_sig x (f x)
hP: P
pi: forall (P : Prop) (p q : P), p = q
H: true = falseFalse
Exercise: Choice and proof irrelevance (advanced)
PI (forall P : Prop, forall h1 h2 : P, h1 = h2) suffices to prove that
choice implies ELEM := forall A : Type, forall a b : A, a = b \/ ~ (a = b).
Prove this, and then deduce that PropExt suffices for Diaconescu's theorem,
i.e. that FunExt is not actually needed.
fun_choice -> (forall (P : Prop) (h1 h2 : P), h1 = h2) -> forall (A : Type) (a b : A), a = b \/ a <> bfun_choice -> (forall (P : Prop) (h1 h2 : P), h1 = h2) -> forall (A : Type) (a b : A), a = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: Aa = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Propa = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Propforall h : {x : A | S x}, exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
H: forall h : {x : A | S x}, exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = ba = b \/ a <> bintros [x [-> | ->]]; cbn; eauto.ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Propforall h : {x : A | S x}, exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
H: forall h : {x : A | S x}, exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
hfa: f (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = true /\ proj1_sig (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = a \/ f (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = false /\ proj1_sig (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
hfa: f (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = true /\ proj1_sig (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = a \/ f (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = false /\ proj1_sig (exist (fun x : A => S x) a (or_introl eq_refl : S a)) = b
hfb: f (exist (fun x : A => S x) b (or_intror eq_refl : S b)) = true /\ proj1_sig (exist (fun x : A => S x) b (or_intror eq_refl : S b)) = a \/ f (exist (fun x : A => S x) b (or_intror eq_refl : S b)) = false /\ proj1_sig (exist (fun x : A => S x) b (or_intror eq_refl : S b)) = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
hfa: f (exist (fun x : A => S x) a (or_introl eq_refl)) = true /\ a = a \/ f (exist (fun x : A => S x) a (or_introl eq_refl)) = false /\ a = b
hfb: f (exist (fun x : A => S x) b (or_intror eq_refl)) = true /\ b = a \/ f (exist (fun x : A => S x) b (or_intror eq_refl)) = false /\ b = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist (fun x : A => S x) a (or_introl eq_refl)) = true
ea2: a = a
hfb: f (exist (fun x : A => S x) b (or_intror eq_refl)) = true /\ b = a \/ f (exist (fun x : A => S x) b (or_intror eq_refl)) = false /\ b = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
eP: f (exist (fun x : A => S x) a (or_introl eq_refl)) = false /\ a = b
hfb: f (exist (fun x : A => S x) b (or_intror eq_refl)) = true /\ b = a \/ f (exist (fun x : A => S x) b (or_intror eq_refl)) = false /\ b = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist (fun x : A => S x) a (or_introl eq_refl)) = true
ea2: a = a
hfb: f (exist (fun x : A => S x) b (or_intror eq_refl)) = true /\ b = a \/ f (exist (fun x : A => S x) b (or_intror eq_refl)) = false /\ b = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist (fun x : A => S x) a (or_introl eq_refl)) = true
ea2: a = a
eb: f (exist (fun x : A => S x) b (or_intror eq_refl)) = true /\ b = aa = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist (fun x : A => S x) a (or_introl eq_refl)) = true
ea2: a = a
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
h2: b = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist (fun x : A => S x) a (or_introl eq_refl)) = true
ea2: a = a
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
h2: b = ba = b \/ a <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
a, b: A
S:= fun x : A => x = a \/ x = b: A -> Prop
f: {x : A | S x} -> bool
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist (fun x : A => S x) a (or_introl eq_refl)) = true
ea2: a = a
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
h2: b = ba <> bac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bFalseac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = btrue = falseac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = btrue = f (exist (fun x : A => S x) b (or_intror eq_refl))ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bf (exist (fun x : A => S x) b (or_introl eq_refl)) = f (exist (fun x : A => S x) b (or_intror eq_refl))ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bexist (fun x : A => S x) b (or_introl eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl) -> f (exist (fun x : A => S x) b (or_introl eq_refl)) = f (exist (fun x : A => S x) b (or_intror eq_refl))ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bexist (fun x : A => S x) b (or_introl eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl)ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bexist (fun x : A => S x) b (or_introl eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl) -> f (exist (fun x : A => S x) b (or_introl eq_refl)) = f (exist (fun x : A => S x) b (or_intror eq_refl))reflexivity.ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bf (exist (fun x : A => S x) b (or_intror eq_refl)) = f (exist (fun x : A => S x) b (or_intror eq_refl))ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bexist (fun x : A => S x) b (or_introl eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl)ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bA = A -> (fun x : A => S x) = (fun x : A => S x) -> b = b -> or_introl eq_refl = or_intror eq_refl -> exist (fun x : A => S x) b (or_introl eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl)ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bor_introl eq_refl = or_intror eq_reflac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bA = A -> (fun x : A => S x) = (fun x : A => S x) -> b = b -> or_introl eq_refl = or_intror eq_refl -> exist (fun x : A => S x) b (or_introl eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl)ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = b
H: A = A
H0: (fun x : A => S x) = (fun x : A => S x)
H1: b = b
H2: or_introl eq_refl = or_intror eq_reflexist (fun x : A => S x) b (or_introl eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl)reflexivity.ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = b
H: A = A
H0: (fun x : A => S x) = (fun x : A => S x)
H1: b = b
H2: or_introl eq_refl = or_intror eq_reflexist (fun x : A => S x) b (or_intror eq_refl) = exist (fun x : A => S x) b (or_intror eq_refl)apply pi. Qed.ac: fun_choice
pi: forall (P : Prop) (h1 h2 : P), h1 = h2
A: Type
b: A
S:= fun x : A => x = b \/ x = b: A -> Prop
f: {x : A | S x} -> bool
h1: f (exist (fun x : A => S x) b (or_intror eq_refl)) = false
ea2: b = b
ea1: f (exist (fun x : A => S x) b (or_introl eq_refl)) = true
hf: forall x : {x : A | S x}, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bor_introl eq_refl = or_intror eq_reflfun_choice -> PropExt -> forall P : Prop, P \/ ~ Pfun_choice -> PropExt -> forall P : Prop, P \/ ~ Pc: fun_choice
pext: PropExt
P: PropP \/ ~ Pc: fun_choice
pext: PropExt
P: Propforall (Q : Prop) (h1 h2 : Q), h1 = h2c: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2P \/ ~ Pc: fun_choice
pext: PropExt
P: Propforall (Q : Prop) (h1 h2 : Q), h1 = h2c: fun_choice
pext: PropExt
P, Q: Prop
h1, h2: Qh1 = h2c: fun_choice
pext: PropExt
P, Q: Prop
h1, h2: QQ = Truec: fun_choice
pext: PropExt
P: Prop
h2, h1: Trueh1 = h2c: fun_choice
pext: PropExt
P, Q: Prop
h1, h2: QQ = Truetauto.c: fun_choice
pext: PropExt
P, Q: Prop
h1, h2: QQ <-> Truedestruct h1, h2; reflexivity.c: fun_choice
pext: PropExt
P: Prop
h2, h1: Trueh1 = h2c: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2P \/ ~ Pc: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P = TrueP \/ ~ Pc: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P <> TrueP \/ ~ Pc: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P = TrueP \/ ~ Ptauto.c: fun_choice
pext: PropExt
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2True \/ ~ Truec: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P <> TrueP \/ ~ Pc: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P <> True~ Pc: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P <> True
hP: PFalsec: fun_choice
pext: PropExt
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
hP: True
H: True <> TrueFalsec: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P <> True
hP: PP = Truecongruence.c: fun_choice
pext: PropExt
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
hP: True
H: True <> TrueFalsec: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P <> True
hP: PP = Truetauto. Qed.c: fun_choice
pext: PropExt
P: Prop
pi: forall (Q : Prop) (h1 h2 : Q), h1 = h2
H: P <> True
hP: PP <-> True
Exercise: Choice in SProp (advanced)
Read the documentation of SProp and see whether you can prove that choice
for SProp implies ELEM for SProp (without any additional assumption).
To make our life easier, we define how to squash a proposition into a strict proposition.
Definition squash (P : Prop) : SProp := forall S : SProp, (P -> S) -> S.P: PropP -> squash Pfirstorder. Qed.P: PropP -> squash P
The statement.
Definition fun_choice_SProp :=
forall A B (R : A -> B -> Prop),
(forall x, squash (exists y, R x y)) ->
squash (exists (f : A -> B),
forall x, R x (f x)).Auxiliary definition for the proof.
Inductive sig {A : Type} (P : A -> SProp) : Type := exist : forall x : A, P x -> sig P.forall (A : Type) (P : A -> SProp), sig P -> Aforall (A : Type) (P : A -> SProp), sig P -> Aexact x. Defined.A: Type
p: A -> SProp
x: A
p0: p xAfun_choice_SProp -> forall (A : Type) (a b : A), squash (a = b \/ a <> b)fun_choice_SProp -> forall (A : Type) (a b : A), squash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: Asquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SPropsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SPropforall h : sig S, squash (exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
H: forall h : sig S, squash (exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = b)squash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SPropforall h : sig S, squash (exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
x: A
s: S xsquash (exists e : bool, e = true /\ proj1_sig (exist S x s) = a \/ e = false /\ proj1_sig (exist S x s) = b)intros [-> | ->]; cbn; clear s; eauto using sq.ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
x: A
s: S xx = a \/ x = b -> squash (exists e : bool, e = true /\ proj1_sig (exist S x s) = a \/ e = false /\ proj1_sig (exist S x s) = b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
H: forall h : sig S, squash (exists e : bool, e = true /\ proj1_sig h = a \/ e = false /\ proj1_sig h = b)squash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
H: squash (exists f : sig S -> bool, forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b)squash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
H: squash (exists f : sig S -> bool, forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b)(exists f : sig S -> bool, forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b) -> squash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp(exists f : sig S -> bool, forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b) -> squash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
hfa: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true /\ proj1_sig (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = a \/ f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = false /\ proj1_sig (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
hfa: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true /\ proj1_sig (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = a \/ f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = false /\ proj1_sig (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = b
hfb: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = true /\ proj1_sig (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = a \/ f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false /\ proj1_sig (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
hfa: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true /\ a = a \/ f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = false /\ a = b
hfb: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = true /\ b = a \/ f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false /\ b = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true
ea2: a = a
hfb: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = true /\ b = a \/ f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false /\ b = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
eP: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = false /\ a = b
hfb: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = true /\ b = a \/ f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false /\ b = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true
ea2: a = a
hfb: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = true /\ b = a \/ f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false /\ b = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true
ea2: a = a
eb: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = true /\ b = asquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true
ea2: a = a
h1: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false
h2: b = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true
ea2: a = a
h1: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false
h2: b = bsquash (a = b \/ a <> b)ac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true
ea2: a = a
h1: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false
h2: b = ba = b \/ a <> bac: fun_choice_SProp
A: Type
a, b: A
S:= fun x : A => squash (x = a \/ x = b): A -> SProp
f: sig S -> bool
hf: forall x : sig S, f x = true /\ proj1_sig x = a \/ f x = false /\ proj1_sig x = b
ea1: f (exist S a (sq (a = a \/ a = b) (or_introl eq_refl))) = true
ea2: a = a
h1: f (exist S b (sq (b = a \/ b = b) (or_intror eq_refl))) = false
h2: b = ba <> bac: fun_choice_SProp
A: Type
b: A
S:= fun x : A => squash (x = b \/ x = b): A -> SProp
f: sig S -> bool
h1: f (exist S b (sq (b = b \/ b = b) (or_intror eq_refl))) = false
ea2: b = b
ea1: f (exist S b (sq (b = b \/ b = b) (or_introl eq_refl))) = true
hf: forall x : sig S, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bFalseac: fun_choice_SProp
A: Type
b: A
S:= fun x : A => squash (x = b \/ x = b): A -> SProp
f: sig S -> bool
h1: f (exist S b (sq (b = b \/ b = b) (or_intror eq_refl))) = false
ea2: b = b
ea1: f (exist S b (sq (b = b \/ b = b) (or_introl eq_refl))) = true
hf: forall x : sig S, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = btrue = falseac: fun_choice_SProp
A: Type
b: A
S:= fun x : A => squash (x = b \/ x = b): A -> SProp
f: sig S -> bool
h1: f (exist S b (sq (b = b \/ b = b) (or_intror eq_refl))) = false
ea2: b = b
ea1: f (exist S b (sq (b = b \/ b = b) (or_introl eq_refl))) = true
hf: forall x : sig S, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = btrue = f (exist S b (sq (b = b \/ b = b) (or_intror eq_refl)))reflexivity. Qed.ac: fun_choice_SProp
A: Type
b: A
S:= fun x : A => squash (x = b \/ x = b): A -> SProp
f: sig S -> bool
h1: f (exist S b (sq (b = b \/ b = b) (or_intror eq_refl))) = false
ea2: b = b
ea1: f (exist S b (sq (b = b \/ b = b) (or_introl eq_refl))) = true
hf: forall x : sig S, f x = true /\ proj1_sig x = b \/ f x = false /\ proj1_sig x = b
h2: b = bf (exist S b (sq (b = b \/ b = b) (or_introl eq_refl))) = f (exist S b (sq (b = b \/ b = b) (or_intror eq_refl)))